Labor candidate Mary Doyle has won a by-election in the federal seat of Aston in Melbourne's outer eastern suburbs.
It is the first time in more than a century that a government has won a seat from the opposition at a by-election.
Liberal candidate Roshena Campbell called Ms Doyle on Saturday evening to concede defeat, while Prime Minister Anthony Albanese called Ms Doyle to congratulate her.
The vote count is still going ahead, but the ABC is projecting a swing towards Labor of about 6 per cent.
The result is considered a devastating blow for the federal Liberal Party, which now only holds three suburban Melbourne seats.
Former Liberal strategist Tony Barry called the result "cataclysmically bad" for the Liberal Party.
Of the 26 federal seats across Melbourne, the Liberals now hold just three, counting Casey as peri-urban, he said.
Mr Barry added the by-election had come at a time of peak popularity for the Labor prime minister, while the Victorian Liberal Party's unpopularity had hurt its federal counterpart.
Former Labor strategist Kos Samaras said the Chinese community in Aston may have ditched the Liberals because of how unwelcome the Coalition government had made many of them feel in recent years.
Aston has long been safe Liberal territory. The last time Labor held the seat was in 1990.
The by-election was triggered by the resignation of former Liberal frontbencher Alan Tudge.
He has held the seat since 2010 but suffered a 7.6 per cent swing against him at last year's federal election to retain the seat by 2.8 per cent.
Two hours into vote counting, the ABC's chief election analyst Antony Green said Labor's Mary Doyle appeared to have a clear lead over Liberal candidate Roshena Campbell.
"This is a devastating swing," Green said.
Labor celebrates, the Liberals concede
Deputy Prime Minister Richard Marles told Labor's post-by-election party that the election result "speaks to Mary Doyle's values, her decency, her hard work".
Ms Doyle then took the stage to raucous applause, describing herself as a suburban mum who's lived in the outer east for 35 years.
"We were the underdog, but boy have we shown that we have a big bite," Ms Doyle said.
"This is an extraordinary endorsement of the Albanese government's positive plans for the country."
The by-election was her second attempt at winning Aston for Labor, having vied for the seat at the general election last year.
Opposition Leader Peter Dutton attended the Liberals' campaign headquarters on Saturday evening, and thanked Roshena Campbell for her efforts.
“I promise you, we never give in," he said.
Addressing reporters, he said Victoria was a very "difficult market" for the Liberals and the party needed to respectfully listen to the electorate.
"I will make sure we build this party into an election-winning machine by 2025," he said.
Ms Campbell told her deflated supporters: "We will fight on."
Both major parties were surprised by the by-election result, ABC political journalist Patricia Karvelas said.
Aston has a higher proportion of families with children than other seats, and a higher percentage of mortgage holders.
The seat also has a large Chinese-ancestry population of 14 per cent, compared to a nationwide figure of 5.5 per cent, and an internal post-election review of the Liberal Party's performance revealed that the government suffered heavy swings against it in seats with large numbers of Chinese voters.
The by-election had been billed as the first opportunity for voters to deliver a verdict on the Albanese government's performance, particularly in the context of the cost of living crisis gripping Australia.
It was also seen as a referendum on Peter Dutton's leadership of the Liberal Party.