The Liberal Party's John Alexander has won the crucial by-election in the federal Sydney seat of Bennelong, despite a swing of more than 5 per cent to Labor.

Key points: Mr Alexander said he was grateful and "humbled" by the win

Mr Alexander said he was grateful and "humbled" by the win Opposition Leader Bill Shorten said "no doubt that after the next general election Labor will form a government"

Opposition Leader Bill Shorten said "no doubt that after the next general election Labor will form a government" If the Liberals had lost, the Federal Government would have lost its one-seat majority in the Lower House

There was a lot riding on the result — if the Liberals lost the Federal Government would have lost its one-seat majority in the Lower House.

Mr Alexander resigned last month after he was caught up in the citizenship fiasco, when he became concerned he was a British dual citizen, paving the way for the dirty and personal by-election battle.

Prime Minister Malcolm Turnbull joined Mr Alexander onstage to claim victory in front of Liberal Party supporters in Bennelong.

Mr Turnbull was ecstatic — and relieved — as they claimed the win.

"John Alexander is an honest man, he's a hardworking man he has served us for many years. He is a good man, he is my choice today and that's what thousands of people have said," Mr Turnbull said.

"John, you are Bennelong's champion just as you have been Australia's champion."

Prime Minister Malcolm Turnbull joined John Alexander in Bennelong in the dying days of the campaign. ( AAP: Mick Tsikas )

Mr Alexander said he was grateful and "humbled" by the win.

"This is an extraordinary moment for us. The last four or five weeks have been a tumultuous time and it's been a real battle," Mr Alexander said.

"I think there's many positives to take from this but firstly I think I have to say to the people of Bennelong that it has been regrettable that we had to go through this experience, that we had to have a by-election."

Labor confident the swing is a sign of good things to come

Meanwhile Labor's candidate Kristina Keneally and Opposition Leader Bill Shorten seemed to claim a victory of sorts, in their incredibly upbeat concession speeches.

Speaking to the small army of Labor volunteers, Mr Shorten said he was confident the swing to Labor was a sign of things to come.

"Kristina may not have won the election tonight, but she and you and the voters of Bennelong have given Labor an election-winning swing at the next election," Mr Shorten said.

"I have no doubt that after the next general election Labor will form a government and something like 24 to 28 government seats will fall and we will make this country a country that's governed in the interests of the middle and working class and not the top end of town."

Kristina Keneally conceded defeat but said the result sent a message to the Government. ( AAP: Ben Rushton )

Ms Keneally was similarly jubilant, despite her loss.

"It seems like we are going to achieve about 5.5 to 6 per cent swing to the Labor Party. Friends, that is in a safe Liberal seat," Ms Keneally said.

"Let's just understand what this means. If this result was replicated at a general election we would see 24 to 28 seats fall.

"We said when we went into this that we were the underdogs. We needed to achieve a 10 per cent swing, we needed to get 9,000 people to change their vote from how they voted just a year ago."

Labor's Bennelong candidate Kristina Keneally is a political commentator and was NSW premier from 2009 to 2011. ( ABC News )

Labor picked the former NSW premier to go up against Mr Alexander to capitalise on the saga, but the Coalition repeatedly attacked her record in state politics.

The journalist was the state's leader from 2009 to 2011.

Ms Keneally claimed Mr Turnbull was "China-phobic" and pledged to "stand up for the Chinese community in Bennelong".

Mr Alexander's campaign was hindered by allegations he delayed revealing his constitutional concerns, and accusations the Coalition is running anti-China rhetoric in its attack on outgoing Labor senator Sam Dastyari.