The anti-European Union UK Independence Party has won its second seat in parliament in a blow to the ruling Conservative party that could indicate upheaval in May's general election.

Mark Reckless, who defected to the anti-immigration UKIP from Prime Minister David Cameron's Conservative Party in September, beat the Conservative candidate on Friday on a margin of just under 3,000 votes in Thursday's by-election in the town of Rochester.

UKIP's Mark Reckless delivers a speech after winning Thursday's by-election in the town of Rochester [AFP]

Speculation over further defections to UKIP swirled after Reckless suggested two more Conservative lawmakers could switch, piling pressure on Cameron six months from the May general election.

Furious campaigning by the Conservatives to keep the once-safe Rochester and Strood seat failed to steal back momentum, and experts portrayed the election as a historic moment in British politics.

The by-election came a month after the Conservatives lost a previously safe seat of Clacton to another defector, Douglas Carswell, handing UKIP its first ever seat in the national parliament.

The prime minister has already promised a referendum on Britain's EU membership if his party wins next year's general election and has taken a harder stance on immigration in a bid to stem the flow.

Source: Al Jazeera and agencies