In a major speech in London, David Cameron said the Conservative manifesto for the 2015 election would ask for a mandate to negotiate a "new settlement" for the UK in Europe, which would be put to voters in a referendum within the first half of the five-year Parliament.
But Mr Cameron said he would campaign "with all my heart and soul" for the UK to stay in the European Union when the referendum came.
He warned voters that if the UK did decide to leave, it would be "a one-way ticket, not a return".
Mr Cameron called for a new EU treaty to:
l Reshape the 27-nation bloc.
l Resolve the problems of the Eurozone.
l Allow the transfer of powers back from Brussels to national governments.
l Make Europe's economy more competitive and its institutions more flexible and democratically accountable.
Mr Cameron said it was his "strong preference" to enact these changes for the whole EU, not just the UK alone.
But if other member states were unwilling to go ahead with a new treaty, Mr Cameron said he was ready to renegotiate the UK's position to achieve a settlement "in which Britain can be more comfortable and all our countries can thrive".
Mr Cameron said: "The next Conservative manifesto in 2015 will ask for a mandate from the British people for a Conservative Government to negotiate a new settlement with our European partners in the next Parliament.It will be a relationship with the single market at its heart.
"And when we have negotiated that new settlement, we will give the British people a referendum with a very simple in-or-out choice. To stay in the EU on these new terms or come out altogether. It will be an in/out referendum.
"Legislation will be drafted before the next election. And if a Conservative Government is elected we will introduce the enabling legislation immediately and pass it by the end of that year.
"And we will complete this negotiation and hold this referendum within the first half of the next Parliament.
"It is time for the British people to have their say. It is time to settle this European question in British politics."
But former Labour Cabinet minister Lord Mandelson said Mr Cameron appeared to have conceded "game, set and match to the hardliners in his party".
And ex-LibDems' leader Paddy Ashdown said: "Mr Cameron has effectively told us it is his intention to put Britain on a one-way street to leaving Europe."