The party's candidate Simon Lightwood received 13,166 votes - 4,925 ahead of Conservative Nadeem Ahmed who received 8,241 votes. He took 47.9 per cent of the overall vote, almost 18 per cent of Mr Ahmed.
The Wakefield result was announced just minutes before it was confirmed the Tories had also lost the Tiverton and Honiton seat in Devon in an even bigger swing.
Mr Lightwood, an NHS communications boss, said “the next Labour government has been born in this room tonight” after being declared the winner following the count at Thornes Park Stadium in Wakefield.
In his speech after being declared the winner of the West Yorkshire by-election, he said: “Tonight, the people of Wakefield have spoken on behalf of the British people. They have said unreservedly: ‘Boris Johnson, your contempt for this country is no longer tolerated’.
“It’s not acceptable that a quarter of our children in Wakefield live in poverty, it’s not acceptable that hundreds of people leave A&E every month without being treated because of record NHS waiting times, and it’s not acceptable that convictions for crimes like robbery have fallen by almost half in the past five years.
“People in Wakefield and across the country are sick of the deceit and dishonesty of this Government.”
Mr Lightwood thanked his campaign team for “the countless hours and sacrifices you have made to ensure we turn Wakefield red again”.
He said: “In this election, we offered a vision for Wakefield that was positive, full of ideas, hope and aspiration, all guided by the principle that politics should be about creating a better country for us all
“Only Keir Starmer’s Labour Party has the vision and the ideas to make life better for everybody in this country.
“We will restore trust and integrity in British politics, and build an economy that tackles the root causes of poverty whilst lifting the aspirations of all.
“My message to the people of Wakefield is this: I will restore trust in our politics by working night and day to address the issues which you care about.”
Following the result Labour leader Sir Keir Starmer said: "Wakefield has shown the country has lost confidence in the Conservatives. This result is a clear judgement on a Conservative party that has run out of energy and ideas.
"Wakefield has voted Labour because we have the solutions for the challenges facing the British people.
"The Labour party is back on the side of working people, winning seats where we lost before and ready for Government."
At the last election, the Conservatives took the Wakefield seat for the first time since 1932, winning a 3,358 majority. The by-election result represented a 12.7 per cent swing to Labour as the Tory vote dropped by over 17 per cent on the last election.
The by-election was called after Tory MP Imran Ahmad Khan was convicted of a sexual assault on a 15-year-old and jailed for 18 months.
Turnout in the Wakefield by-election was 39.09 per cent - well down on the 64.1 per cent at the last election. Some 27,205 verified ballots were cast out of a total electorate of 69,601.
Speaking before the result was announced, Andrea Jenkyns is the Conservative MP for Morley and Outwood, said the election was always going to be difficult for the Tories due to the circumstances in which the by-election was called.
"There has been apathy but it is mid-term and we have in 12 years. It is typical of by-elections.
"One thing that was really noticeable is Labour has not cut through. There is not a love for Starmer. He is not cutting through the North which they need to.
"We are starting from not a good starting point as a party, it is horrific circumstances regarding why we have got a by-election.
"Over 80 years this was a Labour seat and they gave the Conservatives a chance. No doubt they must have felt badly let down in the circumstances in which the MP resigned. That is certainly going to be a factor."
She insisted that there was still support for Boris Johnson across much of Wakefield.
"But on the doorstep in certain areas we went in there is a great love of Boris. I really found that in the very working-class areas."
"The history of by-elections there is usually a swing of 17.5 per cent to opposition parties. If Labour don't storm this, I question why. Look at the circumstances of the by-election."
Ms Jenkyns confirmed Mr Johnson had been due to visit the constituency in the run-up to the election but it did not happen.
"He was going to come and had been planned to come up later in the campaign. We have had nearly 130 MPs up, as a whip I have been one of the whips whipping them to get them here."
She said it was hard to say whether an appearance by the Prime Minister would have made any difference to the result.
"It was circumstances, he had to go to Ukraine and he has had an operation this week. Who knows, it is a difficult question to answer. There is Captain Hindsight, I'm not Mrs Hindsight. It is very difficult to answer that.
She said Partygate had only come up a "handful of times" on the doorstep.
"It was more about the cost-of-living. People are struggling to afford to pay the bills. That affects turnout as well."
Ms Jenkyns said she was not concerned about the potential of another rebellion against the Prime Minister following the recent confidence vote.
"We have got people who want to be leader, we have got ex-ministers who are on the backbenches, on politics you always get people with a gripe.
"A few days after the vote of no confidence, things changed in the party - there was a calmness and I know that as a whip. I think people want to feel they had their voice heard but the Prime Minister won it. The majority of us support him and Conservatives just want us to get on with things."
At The Yorkshire Post, we are committed to speaking truth to power on behalf of the people who call God’s Own County their home. Our political team and Westminster Correspondent are Yorkshire's eyes and ears in the corridors of power.
If you’d like all the latest political news straight to your inbox, you can sign up to our newsletter for free at: https://www.yorkshirepost.co.uk/newsletter