A victorious Chloe Smith praises the former MP Ian Gibson in her acceptance speech Press Association

David Cameron today hailed the Tories' byelection victory in Norwich North as a "historic" result for his party and insisted it showed that the public had "had enough" of Gordon Brown.

On his seventh visit to the constituency since the contest began, the Tory leader heaped praise on his newest MP, 27-year-old Chloe Smith, for turning a Labour majority of 5,000 into a majority of more than 7,000 for the Conservatives.

"This in a seat that has been controlled by Labour for 45 of the last 60 years," he said.

Cameron added: "We have seen an absolutely historic victory in Norwich North. It shows this country has had enough of Gordon Brown's dividing lies. This country has had enough of misleading claims about opponents. This country has had enough about misleading claims about Tory cuts."

Cameron spoke after his party inflicted a humiliating byelection defeat on the prime minister.

In the first electoral test in a Westminster seat since the MPs' expenses scandal rocked the House of Commons, Smith won the Norfolk seat with a majority of 7,348 and became the youngest MP in the Commons.

Labour's defeat, in a seat held comfortably by the party since 1997, is the fifth byelection blow Brown has suffered since he took over at No 10.

If the result was repeated across the country in a general election, the Tories would be swept to power with a Commons majority of 218.

The Tories would have 434 MPs, with Labour on 107, the Liberal Democrats 79, and others 30.

Responding to the news, the prime minister admitted it was a disappointing result but said no party could take a "great deal of cheer" from it because all three of the main parties had lost votes.

"The Conservative vote went down, the Liberal vote went down; only the fringe parties saw their votes going up," he said.

"I think it's a lesson that we have all got to observe. We have got to clean up Westminster politics and we are doing that. But we have got to keep our eye on what is important to people and that is the economic recovery.

"We've got to deal with all problems that arise. That includes swine flu, where we're acting in a calm, organised and ordered way to deal with the problem and help people in every part of the country."

Cameron visited the constituency six times during the campaign, which was triggered by the resignation of Labour's Ian Gibson following the MPs' expenses scandal. The popular MP had a 5,459 majority at the last election in 2005.

Following today's count, Smith won with a total 13,591 votes. Labour's Chris Ostrowski, who missed the final days of campaigning due to swine flu, received 6,243 votes and the Liberal Democrat candidate April Pond came third with 4,803 votes.

The UK Independence party pipped the Greens to fourth place by 4,068 votes to 3,350.

The 16.49% swing from Labour to the Conservatives at Norwich North was just short of the 17.61% at last year's Crewe and Nantwich byelection.

Turnout was 45.88% – down almost a third on the 2005 general election figure of 61.09%.

Labour supporters are thought to have stayed at home in protest against the party's treatment of Gibson, who stood down as an MP after Labour ruled that he would not be allowed to stand for the party at the next election because he had used parliamentary expenses to fund a flat that he subsequently sold to his daughter at a discount.

In her acceptance speech, Smith paid tribute to her predecessor, saying he was a "strong, independent" voice. She pledged to represent the people of Norwich North with the same honesty and conviction as he had.

"I will be a tireless champion for local people," she said. "You have invested great responsibility in me. It will be an honour to serve you and I will not let you down."

Ben Bradshaw, the culture secretary, insisted that the party had been right to take tough action against MPs over their expenses despite today's result.

Jo Swinson, the 29-year-old Liberal Democrat MP had held the unofficial title of "baby of the house" until today.