The Turnbull government holds onto its slim majority in the federal parliament after John Alexander retained Bennelong in Saturday's by-election.
The Turnbull government has retained its one-seat majority after John Alexander won back the Sydney seat of Bennelong, despite a swing against him following a bitterly fought campaign.
Mr Alexander's victory against Labor's star candidate, former NSW premier Kristina Keneally, will come as a relief to Prime Minister Malcolm Turnbull.
A loss would have left the government with 75 seats, in the 150-seat House of Representatives, forcing it to rely on the cross bench to get its legislation through.
It would also have put Mr Turnbull's leadership under pressure.
But with nearly 80,000 votes from 37 of 39 booths counted, Mr Alexander had won 59.72 per cent of the two-candidate preferred vote compared to Ms Keneally's 45.86 per cent despite a swing against him of 5.58 per cent.
Nearly 6,000 people lodged informal votes.
On primary votes, Ms Keneally had a swing of 7.59 per cent, which has buoyed Labor leader Bill Shorten.
"(Mr Turnbull) said this was a poll on him and his government. Malcolm Turnbull, you are correct. It was," he told the Labor function.
He said the swing to Labor in Bennelong would give it an election-winning swing at the next federal poll.
Manager of government business Christopher Pyne said it was a win for Mr Alexander and win for Mr Turnbull who faced pressure on his leadership if the government had lost the by-election.
"Malcolm Turnbull has ended the year on an incredible high," he told Sky News.
"Bill Shorten starts next year facing a potential four by because he didn't get his house in order."
The by-election in the northwestern suburban electorate in Sydney was called after Mr Alexander resigned from parliament after he suspected he was a dual citizen.
It became a tight contest after Labor took up the fight for the seat by selecting former Ms Keneally, and throwing big names and resources into its campaign.
Mr Shorten and Mr Turnbull spent many days campaigning in the seat, alongside many other high-profile government and opposition figures.
Labor has said that if the swing against Mr Alexander was replicated across the country, the goverment would lose 23 seats.
"You cannot translate a by-election result in Bennelong across the whole nation," Mr Pyne said.
Former Liberal senator Cory Bernardi's new party, Australian Conservatives is running a candidate, who has attracted around 4.7 per cent of the primary vote.
It appears most of Joram Richa's preferences have gone to Mr Alexander.
It was the second by-election the government had to contest over the dual citizenship fiasco.
Deputy Prime Minister Barnaby Joyce recorded a thumping win in his seat of New England earlier this month.
Up to four Labor MPs may find themselves facing by-elections with issues over their citizenship.