The United Kingdom Independence Party has gained its second directly-elected MP with victory over the Conservatives in the Rochester and Strood by-election.
Mark Reckless, who defected from the Tories to spark the showdown with his former party, won by a majority of 2,920.
The result is a serious blow for British Prime Minister David Cameron, who personally led the effort to stop UKIP's recent surge with less than six months to go until a general election.
It comes just weeks after another defector, Douglas Carswell, comfortably won a seat for UKIP in a contest in Clacton, Essex.
But the smaller-than-forecast margin of defeat may calm nerves that more eurosceptic backbenchers will be tempted to join UKIP.
Mr Reckless's mother emigrated from Ireland to England when she was 17 and his grandfather was a Fianna Fáil TD for Donegal.
He said his victory had proved that UKIP could win nationwide and urged voters to ensure enough MPs were elected to hold the balance of power after 2015.
"Whichever constituency, whatever your former party allegiance, think of what it would mean to have a bloc of UKIP MPs at Westminster large enough to hold the balance of power," he said.
"If you believe in freedom, if you believe in low taxes, if you believe in clean government, if you believe in localism, if you believe in people power.
"If you believe that the world is bigger than Europe, if you believe in an independent Britain, then come with us and we will give you back your country."
I'm determined to win back Rochester and Strood at the election - anything other than a Conservative Govt would put our recovery at risk.
— David Cameron (@David_Cameron) November 21, 2014
UKIP leader Nigel Farage said the "massive, massive" win in what he called a "David v Goliath battle" meant "all bets are off" for 2015.
He said: "[David Cameron] put his own personal reputation on the line to fight this by-election and lost, so there you go."
Labour came third on the day it suffered an embarrassment with the resignation of shadow attorney general Emily Thornberry over what was called a "snobbish" tweet about an English flag-draped house in the constituency.
The Liberal Democrats continued a humiliating string of by-election performances, finishing fifth behind the Green Party with just 349 votes and losing another deposit.
A total of 40,113 votes were cast, which was a turnout of 50.67%.