In the party's strongest showing in a Westminster byelection, Ukip secured 21.79% of the vote in Rotherham, claiming second place behind Labour, which won with 46.25%. The Lib Dems trailed in eighth place on 2.11%.

Labour scored a hat-trick of comfortable victories in the three byelections held in its safe seats of Rotherham, Middlesbrough and Croydon North.

Sarah Champion won with 9,866 votes in Rotherham, though Labour's overall vote increased by just 1.62%. Labour's failure to build significantly on its support may have been due to anger over the resignation of the previous Labour MP, Denis MacShane, after a Commons committee censured him over his expenses.

Andy McDonald won for Labour in Middlesbrough with 10,201 votes, an increase of 14.6 points. In Croydon North, Labour's vote increased by 8.69 points as Steve Reed won with 15,898 votes.

Ed Miliband said the results were an endorsement of his centre ground "one nation" Labour strategy. "Voters in Croydon, Rotherham and Middlesbrough have put their faith in a one nation Labour party standing up for young people trying to find work and standing up for people whose living standards are being squeezed," the Labour leader said.

The results showed that Ukip will be a major presence in British politics in the run-up to the 2014 European parliamentary elections, which Farage hopes to win. Ukip also came second in Middlesbrough, with 11.8% of the vote, up 8.1 points, and third in Croydon North behind the Tories, with 5.7% of the vote.

The Lib Dems came third in Middlesbrough with 9.91% of the vote, down 10 points, and fourth in Croydon North with 3.5% of the vote, down 10.48 points.

Farage hailed the results, which followed a strong showing in Corby earlier this month, as a sign that Ukip has achieved a breakthrough. He told The World at One on Radio 4: "We have established ourselves now as the third force in British politics. We have beaten the Lib Dems in all forms of elections over the course of this year. We are clearly and consistently now above the Lib Dems in the opinion polls.

"There is an upward trend. And I think the Ukip message is resonating with voters and not just Tory voters. There are plenty of voters, particularly in the north of England, coming to us from Labour and the Lib Dems."

The Lib Dems said they were being punished for taking tough decisions in government, allowing Ukip to pick up protest votes. Simon Hughes, the Lib Dem deputy leader, told BBC News: "The Liberal Democrats generally are getting punished for taking the country through a time of austerity. The Labour party are in difficulty even in their safe seats. They can't just assume it's a walk in the park. And Ukip have become the party of protest and are playing it because of a general concern about all that's going on in Europe. So it's not difficult to understand."

But John Curtice, professor of politics at Strathclyde University, said the Lib Dems were facing a serious challenge after suffering their worst performance in a byelection since 1945. "By my calculations, this was the worst postwar result in any English byelection for the Liberal Democrats," he told the BBC.

Curtice questioned the claim by the Lib Dem leadership that it was suffering the usual government mid-term blues. "It's a bit more than that. It's lot of voters who voted Liberal Democrat in 2010 who are now of the view that what the party is doing in office is not what it said it would do when it was campaigning, and therefore they've lost a lost of trust. And it's looking as though that's going to be very difficult to turn around. Nick Clegg apologised for the tuition fees volte-face a few months ago. It does not seem to cut any ice with voters at all."

Curtice agreed that Ukip was now a major presence. "Ukip are probably hoping that they are now on a roll, certainly all the way through to the European elections in June 2014. Certainly, last night's performances were not a flash in the pan."