Theresa May has said the Conservatives’ “astounding” victory in the Copeland by-election shows her government “is working for everyone”.
The Tories swept aside Labour, which had held the Cumbria seat for 80 years, to record the first by-election gain by a sitting government in 35 years.
Mrs May said the success showed her party’s broad appeal across England.
Labour leader Jeremy Corbyn has insisted he will stay on after it won a separate poll in Stoke Central.
But one Labour has urged him to consider his position following the Copeland loss.
On a visit to the constituency, Mrs May said newly elected MP Trudy Harrison had upset the odds in a seat held by Labour since the 1930s.
- Live reaction to by-election results
- Analysis: Three problems for Labour
Speaking in Millom, Mrs May told supporters: “What we’ve seen from this victory is this truly is a government that’s working for everyone and every part of the country – and that’s the message that we bring here to Copeland and we’ll take across the country.”
She praised Mrs Harrison as “such a fantastic candidate”, one who does not just talk about things, but who “actually rolls up her sleeves and gets things done”.
Labour had held both Stoke and Copeland since their creation but was forced to defend them when two former frontbenchers, Tristram Hunt and Jamie Reed, resigned as MPs.
Copeland, created in 1983, and its predecessor constituency Whitehaven have returned Labour MPs since 1935.
Mrs Harrison, who had been joined by Mrs May on the campaign trail, got 44.3% of the vote, increasing the Conservatives’ vote share by more than 8%. She overturned a Labour majority of more than 2,564 to take the seat by 2,147 votes – a swing of more than 6%.
Professor John Curtice, of Strathclyde University, said the Copeland result was the best by-election performance by a governing party in terms of the increase in its share of the vote since January 1966.
In her victory speech, Mrs Harrison said: “It’s been very clear talking to people throughout this campaign that [Labour leader] Jeremy Corbyn doesn’t represent them.
Analysis: May strengthened, anguish for Labour
By Norman Smith, assistant political editor
Theresa May this morning finds her grip on British politics hugely strengthened.
For a governing party after seven years of austerity to be sweeping aside Labour in a heartland seat and to see their share of the vote increase in another is an extraordinary achievement.
It will be taken by her supporters as a vindication of her hard-edged drive towards Brexit and her break with the more metropolitan politics of David Cameron.
As for Labour, relief that it has at least repulsed the perceived threat of UKIP but its slow painful anguish under Jeremy Corbyn seems set to continue.
In normal times, both by-elections should have raised barely a flicker of concern and while the slide in support may not ignite a further leadership challenge, the convictions of Mr Corbyn’s critics that he is leading the party into the wilderness will only have been strengthened.
“They want a party which is on the side of ordinary working people, which will respect the way we voted in the referendum and which will build a country which represents everyone. That’s why they voted for me tonight.”
Mr Corbyn said Labour’s “message was not enough to win through in Copeland” but hailed victory in Stoke as a “decisive rejection of UKIP’s politics of division and dishonesty”.
He added: “Labour will go further to reconnect with voters and break with the failed political consensus.”
But Labour MP John Woodcock, a critic of the leader, said as things stood the party was on course for a “historic and catastrophic defeat” at the next general election.
In Stoke-on-Trent, UKIP had hoped to capitalise on voters’ leanings towards Brexit – the area voted strongly to leave the EU in June.
Both the Labour and UKIP candidates had tough moments during their campaigns, with Mr Snell apologising over old social media posts about women appearing on television and Mr Nuttall facing a backlash over false claims he lost close friends in the Hillsborough tragedy.
- Labour MP: ‘We’re on course for catastrophic defeat”
- Nuclear views sparked ‘shock’ election
- Eleven famous by-elections
- Professor Green appears at election count
But in his victory speech, the new Labour MP Gareth Snell said voters had “chosen the politics of hope over the politics of fear”.
“This city will not allow ourselves to be defined by last year’s referendum and we will not allow ourselves to be divided by the result,” he said.
He said the result was “a victory for the whole Labour Party and Labour movement”.
However Labour’s share of the vote was 37% – slightly down on the 39.3% it got in 2015.
UKIP got 24.7% of the vote and the Conservatives, who came a close third, 24.4% – both slightly higher than their 2015 vote shares.
Analysis: UKIP’s missed chance
By BBC political correspondent Chris Mason in Stoke
The questions facing Labour in Copeland are tumbling UKIP’s way here in Stoke.
A party whose very success in achieving the thing they were set up to achieve, Brexit, brought with it a blunt question – what is the point of them now?
The answer sounded like this: winning traditionally Labour seats from Labour.
And yet here in Stoke-on-Trent, a hubbub of Brexiteer jubilation after the referendum, they failed.
UKIP insists this seat was always well down their target list. But on a night where Labour was sufficiently vulnerable to lose a previously rock-solid seat in Cumbria, UKIP’s still the bridesmaid not the bride in the Potteries.
All of which begs two questions: If not here, where? If not now, when?
Speaking to journalists after the result, UKIP leader Mr Nuttall said his party’s “time would come”.
“There’s a lot more to come from us,” he said. We are not going anywhere, I’m not going anywhere.”
UKIP chairman Paul Oakden said: “The whole narrative of Paul’s leadership depends on winning in Stoke is a nonsense.”
The by-election results mean the government’s majority is now 12 – the same as it was immediately after the general election, as the Conservative’s new Copeland seat makes up for the one they lost to the Lib Dems in the Richmond Park by-election. The working majority is 16.