The Conservatives have won the Copeland by-election, beating Labour in an area it represented for more than 80 years.
Trudy Harrison won with 13,748 votes to 11,601 for Labour's Gillian Troughton.
Mrs Harrison hailed the victory in the Cumbrian seat - the first by-election gain by a governing party since 1982 - as "a truly historic event".
Labour's Gareth Snell held Stoke-on-Trent Central with 7,853 votes, seeing off a challenge from UKIP leader Paul Nuttall who got 5,233.
Labour had held both seats 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 Prime Minister Theresa 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.
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."
Labour MP Jack Dromey, who ran Mr Snell's campaign, said: "I think as we win we need necessary humility because there is a view that Labour is no longer listening in the way it should do.
"I think what we have done in this community is precisely to do that.
"Are we yet a credible alternative government? No we're not. But tonight is a decisive moment."
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.