London: A British Royal Air Force aircraft carrying British Foreign Secretary Philip Hammond was banned from flying through Spanish airspace on its way to Gibraltar, British media revealed on Sunday. The incident took place on Wednesday when the foreign secretary was heading to Gibraltar, a British Overseas Territory on the south coast of Spain, to meet residents to ensure they do not support the country's exit from the EU in the June 23 referendum, the Sunday Express reported. Spanish authorities were aware of Hammond being on board the plane but issued the ban anyway, forcing the RAF pilots to change course and fly via Portugal. Madrid warned Gibraltar residents against voting for exiting the EU, promising to establish a blockade of the territory similar to the one enacted by Spanish dictator General Franco in 1969 which lasted until 1982, well past the general's death. British military aircraft have been banned from flying through Spanish airspace if their final destination was Gibraltar since 1989. Wednesday's reported demarche was accompanied by a refusal of Spanish Justice Minister Rafael Catala to attend a Downing Street reception arranged on the eve of an anti-corruption summit organised by Prime Minister David Cameron. Gibraltar enjoys wide autonomy but its defense issues and foreign relations are taken care of in London. Gibraltar has long been a bone of contention between Madrid and London. The seven-square-km territory with an estimated population of 30,000, situated at the very tip of the Iberian Peninsula, has been under British control since 1713.