Getty Composite

Katy Perry Get Your Head Out of the Sand ... We Got Approval to Film on Dunes!!!

Katy Perry has come out with a "Dark Horse" of a defense in her recent music video drama ... with her record label ponying up proof they were given the OK to film in the sensitive sand dunes of a protected area on a Spanish island.

After the Spanish government kicked off a probe this week into KP's decision to film her "Lifetimes" music video on protected ground, Capitol Records hit back with a response ... saying they were given all the necessary permits to record at the dunes of S’Espalmador.

Per a CR rep, there was one permit that was still lingering before production for the music video kicked off ... but they defend they were given verbal approval the day before shooting began on July 27.

They added ... "We adhered to all regulations associated with filming in this area and have the utmost respect for this location and the officials tasked with protecting it."

This is a strikingly different stance from the Spanish government, whose environmental department for the Balearic Islands accused the music video's production company, WeOwnTheCity of not securing the proper paperwork to film on the famed dunes.

The dunes have been investigated for potential damage, with the area even being roped off. However, the department did clarify they do NOT consider the music video SNAFU a "crime against the environment," just an infringement into their policy.

It's been a "Hot N Cold" summer for Katy, who faced controversy back in June for working again with controversial producer Dr. Luke on her forthcoming album.

Katy has ignored the drama for the most part ... but you can't bury your head in the sand forever.

Click here for info about our online advertising practices.