Representatives from 36 countries from around Europe and the Mediterranean are in Barcelona for a ministerial meeting on the future of European neighbourhood policy, with issues ranging from jihadist terrorism and immigration.
But it was also a rare opportunity for Rajoy and the President of the Catalan government, Artur Mas to appear side by side. And neither could resist a show of brinkmanship during their opening speeches.
Mas welcomed guests in a multi-lingual speech of English, Catalan, French and Spanish, referring to Barcelona as a city with a "vocation as the capital of the Mediterranean and Europe", making no reference to Spain.
Rajoy referred to Barcelona as a "Catalan city that is also the Spanish capital of the Mediterranean" and also made several "veiled references to the Catalan question" according to Catalan daily, La Vanguardia.
The Spanish Prime Minister used his speech to call for unity against jihadism and said it should not be "confused with Islam".
"No one should be swept away by the falsehood that we are talking about a fight by Islam against the West," he said.
"The Islamic world is just as much a victim of this terrorism," he added.
EU foreign policy chief Federica Mogherini called for stepped up cooperation between Europe and its Mediterranean neighbours in North Africa and the Middle East to fight terrorism.
"The recent terrorist attacks in Paris and Tunis, those yesterday in Egypt and at the Moroccan embassy in Libya, show that we must reinforce our cooperation in the fight against terrorism," she said.
"All nations in the region are confronted with a fragile security situation which has worsened due to several armed conflicts, mainly in Syria and Libya," she added.
"We are watching a rise in radicalism on the part of our youths, who are following in greater numbers the call to jihadism in the north and south of the Mediterranean."
To fight terrorism greater cooperation is needed in economic, cultural and political affairs as well as in security matters, Mogherini said.
Algeria, Egypt, Israel, Jordan, Lebanon, Morocco, the Palestinian Authority and Tunisia sent representatives to the meeting as did the 28 nations that make up the European Union.
Syria, which is the target of EU sanctions as part of international attempts to isolate President Bashar al-Assad's government, and Libya, which is engulfed in a civil war, did not take part.
Membership in the Mediterranean Union is open to all states that border the Mediterranean as well as all members of the EU.