The Green party finished fourth in Ealing Southall with 1,135 votes, while the BNP took fourth place in Sedgefield with 2,492 votes.

The prime minister will welcome the result, coming during mid-term when governments traditionally lose support. The result confirms hopes of a "Brown bounce" and could encourage Mr Brown to call an early election.

The Liberal Democrats moved into second place in both seats and leader Menzies Campbell welcomed the result as proof three-party politics was here to stay.

Lib Dem candidate Greg Stone managed to double the party's share of the vote in Sedgefield, overtaking the Tory candidate.

Despite rigorously campaigning in west London, the Conservatives were squeezed into third place in both seats.

Tony Lit stood for "David Cameron's Conservatives" in Ealing Southall and the election was seen as a key test of the new-look Conservatives ability to appeal to ethnic minority urban voters.

However, the Tory campaign suffered setbacks with the defection of councillors and the revelation that Mr Lit was a Labour donor. The Tory candidate was picture smiling alongside Tony Blair days before he was selected to stand for the Conservatives.

The Labour candidate Virendra Sharma attacked the Tories. "It is policies that win elections, not slick PR," he said after the result.

He told reporters: "This is a great result for our new prime minister Gordon Brown and it is a humiliating rebuke from Britain's most diverse constituency to David Cameron's Conservatives.

"David Cameron staked his reputation on this by-election and the people of Southall and Ealing have given their verdict tonight. We don't trust the Tories to represent us. They don't stand for us."

But Mr Lit said the election in Ealing Southall showed it was no longer a safe seat.

Mr Wilson said in Sedgefield: "We have won our victory here tonight because of the success of New Labour under Tony Blair and our renewal with Gordon Brown.

"This election has been a disaster for David Cameron. People know he just can't be trusted when it comes to the big issues."

Nevertheless, Tory Candidate Graham Robb insisted the Tories were "in business" in the north-east and Mr Cameron has refused to see the results as a disaster for his party.

Party chairman Harriet Harman said she was very pleased with the results. She told the BBC both constituencies have selected good local candidates who were fighting on important issues.

Sir Menzies said the results were a disaster for the Conservatives but also a blow for Mr Brown.

He said: "The government must heed the warning that their traditional supporters are sending - disastrous decisions on Iraq and rewarding the richest in society are being rejected by hard-working and fair-minded families."