9.05pm: Goodnight, Wentworth watchers
That's all from us tonight, but the parliament only gets more interesting from here. We haven't had a hung parliament since the Gillard days - and they can be unpredictable.
Watch this space. Thanks for your company, and goodnight.
8.25pm: Sharma concedes
Dave Sharma, the Liberal candidate, has conceded.
He says he's glad he kept his day job. He says he remains "committed to the ethos of public service".
He will "continue to find ways" to serve the community in "ways that suit me". Does that mean a run at the general election, probably only six months away? We'll have to wait and see.
8.20pm: Phelps: 'I am humbled, thank you, thank you'
Independent Kerryn Phelps has delivered her victory speech.
"I am humbled by this privilege and I just want to say thank you, thank you, thank you," she says.
"What we have done is tapped into a sentiment in the Australian people, to talk about the issues that are important to them, not the issues about survival for a particular political party."
Across town, prime minister Scott Morrison has spoken to the Liberal faithful. He says the party will be back.
"We'll take this all the way to the election," Mr Morrison says.
8.04pm: Phelps arrives at election party, speech coming soon
Labor's candidate Tim Murray has congratulated Dr Phelps on her win. We're yet to hear from Mr Sharma, but that's coming soon.
The victorious independent, Dr Phelps, has arrived at her campaign party to rapturous applause.
This is the biggest swing against a sitting government in a by-election in Australian political history. The Phelps camp is ecstatic.
7.31pm: Kerryn Phelps emerges winner, Morrison faces hung parliament
It's a done deal. Pending a lost truckload of Sharma votes, it is all but impossible to see a Liberal recovery from here.
Kerryn Phelps will be the next member for Wentworth.
The Morrison government enters minority government.
Dr Phelps has previously said she doesn’t want to bring down the government, but she’s not going to sign off on bills she fundamentally disagrees with, citing the government’s likely introduction of a Religious Discrimination Act.
Very interesting days ahead in parliament for the Morrison government. The numbers mean they will need to be constantly alert. Labor will continually test their numbers on the floor of the House of Reps.
7.20pm: Revealing texts from camp Liberal as Phelps looks like the winner
My colleague Brett Mason, our bureau chief in Parliament House, is hearing from the Liberal camp.
"It's done," reads one message, with a waving emoji attached.
The ABC has called the by-election for Dr Phelps.
7.14pm: Phelps in the lead
Before tonight, there was talk that Dr Phelps might win if she made it to second place on primary votes.
She might have done a lot better than that.
Right now, she's narrowly beating Mr Sharma in her own right on first-choice votes. Quite astonishing.
7.10pm: Big drop for Liberals as some consider calling it for Phelps, already
These early results are looking very, very bad for Mr Sharma.
Reports from the ABC suggest their analyst may make the call "within minutes".
Official numbers from the AEC now show a 26 per cent swing against the Liberals and a very low primary vote.
Getting harder to see a recovery for the government from here.
6.54pm: First ballot boxes in, showing 20+ swing against Liberals
Early results are coming in from polling places in Double Bay East and Vaucluse.
They suggest a significant swing against the Liberals, and most of the vote bleeding to Dr Phelps.
Current results on the AEC website show a swing of around 23 per cent against Mr Sharma, but these are very early indications.
6.45pm: Intense campaigning in a normally safe seat
Voters in Wentworth aren't used to this much attention.
The polling places have been bombarded by campaigners from the competing parties, but also environmental groups, who are targetting the Morrison government over the death of its National Energy Guarantee.
The posters at the polling places were interesting in terms of last-minute strategy. Read more about those here.
6.34pm: Why did Morrison say his guy was going to lose?

A protester dressed as former prime minister Malcolm Turnbull is seen at a polling place at Bellevue Hill Source: AAP
On Friday, Prime Minister Scott Morrison said he expected his candidate to lose.
Asked by a journalist if Mr Sharma was likely to be defeated, on balance, Mr Morrison responded: "I've been saying that for the last couple of weeks."
"I think the expectations are clearly set in this direction," he said.
Take this with a grain of salt. While the polls don’t look great for Mr Sharma, the prime minister’s comments are probably best characterised as ‘expectation management’.
If he loses, oh well, we told you that was going to happen. If he wins, it looks like an underdog victory in a seat the Liberals actually hold on a 17 per cent margin and would normally hold anyway.
6.24pm: 'Ominous clouds'
Plenty of commentators interpreting this massive storm over Sydney as some kind of electoral omen. Funny how polls bring out the superstitious.
6.16pm: Early exit polls

Sydney radar Source: BOM
The left-leaning Australia Institute thinktank has released an early exit poll. It doesn't do pure numbers, but it suggests a strong result for Dr Phelps, the independent.
It focused on what the issues were for ex-Liberal voters in the seat:
"Among ex-Liberal voters who have now voted for Phelps, climate change was the second-biggest issue (27 per cent) behind Turnbull’s toppling (44 per cent), but 80 per cent of those voters said climate change and getting out of coal had at least some influence on how they voted."
6.10pm: How to win a three-horse race
The Australian voting system means Dr Phelps will need to get to at least second place on first-choice votes to have a chance.
Once the two lead candidates are clear, the preferences from other candidates will be distributed. Labor candidate Tim Murray is the third serious contender, and his supporters’ second choices could play a key role.
How-to-vote cards have an impact, but plenty of voters ignore them too. The ABC’s well-respected elections analyst Antony Green reckons around 80-85 per cent of Greens and Labor preferences will flow to Dr Phelps.
6pm: Polls close in Wentworth
The ballot boxes, and the fates of our 16 candidates, are sealed.
Votes will be counted over the coming hours, and we should know the result this evening. The clearer the margin, the sooner we will know.
There’s a lot at stake in this by-election, and polls suggest we could be in for a photo finish. You can catch up on the context here, but the short version is this:
If Malcolm Turnbull’s former seat falls to independent Kerryn Phelps today, it will end the Morrison government’s one-seat majority in the House of Reps.
The balance of power would then rest with Dr Phelps and the existing crossbenchers – Katter, Sharkie, McGowan and Bandt – who will gain new influence. Already, they have signalled they will use it.
Stay with us.

Source: SBS News