Media playback is unsupported on your device Media caption David Cameron: 'I will not be PM of a government that doesn't deliver referendum'

David Cameron has said he will not lead a government that fails to deliver a referendum on the UK's EU membership.

Earlier Nick Clegg did not rule out joining a coalition with the Tories if they insisted on the poll, but said his "red line" policies would come first.

Nigel Farage said, without UKIP holding the PM's "feet to the fire", he feared any referendum would not be "fair".

Labour opposes the Conservatives' plan for an EU referendum, saying it would cause uncertainty for business.

In other election news:

Conservative leader Mr Cameron has pledged to renegotiate a "better deal" for the UK in Europe and hold a referendum by the end of 2017, if the Conservatives win power.

Labour and the Lib Dems have opposed a referendum unless there are plans for a transfer of more powers to the EU.

Policy guide: EU This election issue includes the UK’s membership of the European Union and its negotiating position.

In an interview with BBC political editor Nick Robinson, Mr Cameron said he would not bargain away his commitment in any coalition negotiations after election day on Thursday.

He said: "People would worry that, were we to fall short [of an overall majority] - and I don't believe we will - but were we to, this is something that could be bargained away and I want to be absolutely clear with people that that will not happen.

"I will not lead a government that doesn't have that referendum in law and carried out."

'Feet to fire'

He added: "I'm confident that in four days' time we will win those 23 seats, we'll have that majority. But come what may, I will not be prime minister of a government that does not deliver that referendum."

Earlier Mr Farage, whose party campaigns for the UK's exit from the European Union, told the BBC Mr Cameron had broken his promise to hold a referendum before, and only decided to promise one when he saw "UKIP spreading like a purple rash across the country".

Analysis by Nick Robinson, BBC political editor

Instability, uncertainty, chaos. Could those words - used again and again by David Cameron to describe the prospect of a minority Labour government propped up by the SNP - apply to a minority Tory government riven by divisions about Europe?

Read more from Nick

"If he held that referendum on his own, without UKIP holding his feet to the fire, I am not confident that it would be a full, free and fair referendum," he said.

The UKIP leader has said holding an in/out EU referendum was "absolutely" a red line for his party - and he would be ready to vote down a Conservative Queen's Speech, if it was not brought forward to this year.

He said that Mr Cameron's plan to use the two years after the general election to renegotiate a "better deal" for the UK in Europe was a waste of time. He also told Sky News he would stand down as UKIP leader "in 10 minutes" if he loses his bid for a Westminster seat on Thursday.

Meanwhile Lib Dem leader Mr Clegg - who leads the most pro-European of the large Westminster parties - said that he had legislated with the Conservatives "to enshrine in law the point at which a referendum will take place" but said the Tory leadership had since "buckled" in the face of pressure from their own right wing.

Image caption Nigel Farage, Nick Clegg and Labour's Yvette Cooper discussed the EU referendum on the Andrew Marr Show

Pressed on whether he would enter another coalition with the Conservatives - if they insisted on holding their promised referendum in 2017 - Mr Clegg did not rule it out but said he would first insist on his own "red lines" before discussing the other party's.

"You ask me the question the wrong way round. I would be saying, I have said to the British people, the Liberal Democrats will not enter into government unless the NHS gets the £8bn it needs."

He added: "Before I address anyone else's red lines I would address mine. "

Meanwhile Mr Miliband - whose party, polls suggest, is still neck and neck with the Conservatives - has said he will not seek re-election as prime minister in 2020, if he fails to deliver a cut in university tuition fees in England from £9,000 a year, to £6,000 a year.

His party accuse the Conservatives of planning to raise fees to £11,500 a year - the Conservatives dismissed the claim as "scare stories" but have not ruled out raising tuition fees further.

Mr Miliband compared his position to the Lib Dem leader Mr Clegg, who apologised for breaking a promise to oppose an increase in university fees.

"I won't break my word as Nick Clegg did. If I had done what he did five years ago, I don't think I could ask you for your trust again. I will cut tuition fees from £9,000 to £6,000.

"And I tell you this, if I fail in this task, I won't be standing here again in 2020 making more promises. I won't be standing for the office of prime minister at all. Because there should be consequences when people's trust is let down."

The Labour leader also appeared to rule out giving Scotland a second referendum on independence, during a visit to Worcester, telling reporters: "Yes, I'm not going to have another referendum on this."

Labour has claimed the Scottish Nationalist Party has a "chilling plan" for a second referendum - although SNP leader Nicola Sturgeon told MSPs last week that "nobody was proposing" one.