David Cameron called today for a fundamental change in Britain’s relationship with the European Union as he made his promise of an “in or out referendum” within five years on whether the country should remain a member of the 27-nation club.

In a landmark speech on Europe that will set the tone for British politics for years, the Prime Minister said the “ever closer union” which was the founding principle of the EU should no longer apply to Britain.

"We understand and respect the right of others to maintain their commitment to this goal. But for Britain – and perhaps for others – it is not the objective. And we would be much more comfortable if the treaty specifically said so, freeing those who want to go further, faster, to do so, without being held back by the others.

Download the new Independent Premium app Sharing the full story, not just the headlines

“Power must be able to flow back to member states, not just away from them,” he said. “Nothing should be off the table.” He added: “The biggest danger to the EU comes not from those who advocate change, but from those who denounce new thinking as heresy. In its long history Europe has experience of heretics who turned out to have a point,” he said.

Mr Cameron pledged that, if the Conservatives win the May 2015 election, a referendum would be held within the first half of the five-year parliament – which means by the end of 2017. It will be the first referendum on Europe since Britain voted in 1975 to stay in the EU, two years after joining.

Although his clear promise of a simple “in or out” vote was welcomed by Tory Eurosceptics, his speech left some crucial questions unanswered. Mr Cameron said he wanted Britain to remain in the EU and was confident of winning a “new settlement”, with some powers returned from Brussels to London, that would enable him to recommend a Yes vote in the referendum. But answering questions after his address, he refused to say what he would do if other EU leaders did not give him a deal he could recommend to the British public. This is seen as a highly possible scenario on the Continent, where other EU nations say the UK cannot “cherry-pick” the EU laws which suit it.

Mr Cameron said he would table Britain’s demands even if the EU backed away from a new treaty to entrench reforms to the eurozone. "If there is no appetite for a new treaty for us all then of course Britain should be ready to address the changes we need in a negotiation with our European partners," he said.

He questioned the EU’s need to legislate on areas such as the environment, social affairs and crime and made clear that Britain wanted to extend its opt-out from aspects of the working time directive. "It is neither right nor necessary to claim that the integrity of the single market, or full membership of the EU requires the working hours of British hospital doctors to be set in Brussels irrespective of the views of British parliamentarians and practitioners,” he said.

Mr Cameron had some words of reassurance for pro-British businessmen. “I never want us to pull up the drawbridge and retreat from the world. I am not a British isolationist. I don’t just want a better deal for Britain. I want a better deal for Europe too. So I speak as British Prime Minister with a positive vision for the future of the EU. A future in which Britain wants, and should want, to play a committed and active part.”