By Elisabeth O'Leary
MADRID (Reuters) - David Cameron won Spain's support on Friday for his campaign for European Union reforms before a British referendum on membership, with his counterpart in Madrid, Mariano Rajoy, saying a British EU exit would be "unthinkable".
Cameron says he wants Britain to remain in a reformed EU and is confident he can get changes - such as tighter restrictions on migrants' access to welfare - that would allow him to recommend a 'yes' vote in the referendum, which he has promised by the end of 2017.
In principle, Spain would "do everything in its power for things to go well" in the renegotiations, Rajoy told a joint news conference after "very positive" talks with his fellow conservative leader.
"It would be unthinkable and a step backwards, that I don't want to even think about, if the United Kingdom were not in the EU," the Spanish prime minister added.
Cameron gave no details of the reforms he is seeking, but a source in his office said the two leaders had discussed issues such as the EU single market and competitiveness. "Clearly there is a much longer way to go before reaching a consensus," the source said.
Cameron is also pressing for a scaling back of regulation, increased free trade and guarantees that British interests are not damaged if the euro zone integrates more deeply.
Just under a year after Scotland came close to voting to secede from the United Kingdom, Cameron threw his weight behind Rajoy's refusal to countenance a similar move in Catalonia.
"We are better together more prosperous, stronger together ... We all, even those who want to take a different path, have to obey the rule of law," Cameron said.
An alliance of pro-independence parties is on course to win Catalan regional elections in late September, which would up the ante in the campaign to secede from Spain.
Cameron and Rajoy earlier made a joint call for structural reforms to make the EU more competitive.
Its main priority should be to conclude negotiations on a free trade agreement with the United States. "Let's make it possible this year," they wrote in a joint article for Spanish financial daily Expansion.