Image caption David Cameron's talks with the Spanish prime minister will mark his first official visit to Madrid

David Cameron is embarking on a series of visits to Spain, France and Germany in a bid to sell his idea of reforming the European Union to other leaders.

The prime minister will meet Spanish counterpart Mariano Rajoy in Madrid before heading to Paris.

He believes the EU needs to change to allow Britain, or other member states, not to be bound by all its decisions.

Ahead of the talks, he told European newspapers support for EU membership was now "wafer-thin" in the UK.

Mr Cameron has argued a new settlement is needed before UK voters are asked if they want to end ties with Brussels.

In his keynote speech on Britain's future in Europe earlier this year, he pledged to hold an in-out referendum during the early part of the next parliament - by the end of 2017 at the latest - if the Conservatives win the next general election.

'Treaty change'

Mr Cameron will make his first official visit to Madrid for bilateral talks with Mr Rajoy on Monday morning, before travelling to Paris for a working dinner with French President Francois Hollande. He will meet German Chancellor Angela Merkel later this week.

The UK prime minister is facing resistance from France and Germany over his plans to create fresh EU agreements.

The BBC's Tom Burridge, in Madrid, said this would be an important week of diplomacy for Mr Cameron.

I think we can have a flexible Europe where we don't all have to do the same things in the same way at the same time David Cameron

"If Mr Cameron is to achieve his goal of a more flexible European Union, in which some countries, and in particular non-eurozone members like Britain, can opt out of certain European laws and directives, he'll have to win over these key European players," he said.

"However the priority right now, for Germany, France and Spain is how to fix the economic crisis within the eurozone. And for that to happen, all three countries are committed to the idea of more Europe, not less."

Ahead of his European visit, Mr Cameron told reporters three treaties had been put forward since he had become prime minister in 2010.

"So I'm sure there will be treaty change," he added. "I'm absolutely convinced that there will be the need to reopen at some stage these treaties, not least to solve the problem of the eurozone.

"The eurozone in my view needs to have further treaty change, and just as eurozone countries will argue that it's necessary to have treaty change, I think it's perfectly legitimate to argue that non-eurozone countries might need to have treaty changes that suit them."

In joint interviews with five European newspapers, Mr Cameron said the EU had "sometimes overreached itself with directives and interventions and interference".

He said the best outcome for Britain would be "membership of a reformed European Union", while arguing the case for a "more flexible Europe".

"Britain is not in the single currency; neither are many other countries. You know, some countries want to go ahead with the financial transaction tax. We don't," he said.

"I think we can have a flexible Europe where we don't all have to do the same things in the same way at the same time."

In his interview Mr Cameron stressed it was important to respond to falling support for the EU in Britain.

He said: "The two themes of my speech are first that Europe needs reform. But the second is that we need to recognise that consent for Britain's membership of the EU and all the ways that it's changed has become wafer-thin in Britain.

"Politicians, if they do their job properly have to recognise this fact rather than try and brush it under the carpet."