Labor has held the seat of Macquarie, according to ABC election analyst Antony Green.
Labor's Susan Templeman was leading by 327 votes with less than 500 to count, he tweeted at 3.15pm on Monday.
Ms Templeman effectively claimed victory at 4pm, saying in a statement: "I believe we are now far enough ahead to confirm that I will serve another term as the Member for Macquarie.
"I want to thank the people of the Blue Mountains and Hawkesbury for this privilege.
"There are lessons to be learned from this election and I look forward to working with the community, particularly those who did not vote Labor."
The seat was the last to be decided in the May 18 federal election, with a neck-and-neck race between incumbent Ms Templeman and Liberal candidate, Sarah Richards.
Ms Richards posted on her campaign Facebook page on Sunday that "no matter what happens with the count, I am going to continue to... work even harder to deliver the real outcomes that Macquarie needs".
She issued a statement on Tuesday morning, thanking "everyone in Macquarie that believed in me and our vision". "When I was out speaking with people over the last few months, they would talk to me about their hopes and aspirations for their families, their kids, and our area. That is what I worked for. And that is what I will continue to keep working for."
The Hawkesbury councillor attended the Coalition's party room meeting in Canberra last Tuesday when the outcome was still unknown, prompting retiring Labor Senator Doug Cameron to accuse the Liberal Party of having "contempt for democracy".
Ms Templeman did not attend Labor's post-election party room meeting in Canberra on Thursday.
Ms Richards defended her appearance to the Gazette, saying in a statement: "I was invited to the party room... to observe on the basis there was still no outcome for the seat of Macquarie. Whatever the outcome, it was a great opportunity to share the hopes and concerns of our residents with the incoming Morrison Government."
Blue Mountains mayor Mark Greenhill congratulated Ms Templeman on her re-election.
"Susan Templeman has always puts community ahead of politics," he said. "She stood with me on the Badgerys Creek airport debate. She stands with the community on all the key issues that confront us and I'm so thrilled she has been returned."
The lead had changed multiple times since election day, May 18, with the counting delayed until today [Monday] to allow for the final postal votes to be considered.
The close race has highlighted the stark divisions between the Blue Mountains and Hawkesbury parts of the electorate, with Labor dominating in the Mountains and the Liberal Party winning in the Hawkesbury.
Susan Templeman's full statement:
"I believe we are now far enough ahead to confirm that I will serve another term as the Member for Macquarie.
I want to thank the people of the Blue Mountains and Hawkesbury for this privilege.
There are lessons to be learned from this election and I look forward to working with the community, particularly those who did not vote Labor.
As a member of the Opposition, I will be fighting to ensure the commitments made to the community by the Liberals are delivered.
I am so proud of my team for doing everything possible that an Opposition office can do to resolve problems people have faced with NBN, the National Disability Insurance Scheme, and Aged Pensions, and I know they will continue to serve the community to the best of their ability.
I thank the wonderful, generous people spread across this electorate, both inside and outside the Labor Party, who worked hard to support me, and this win is theirs.
I particularly want to thank my daughter Phoebe, who chose to share her personal experience of mental illness during this campaign. The feedback was that Phoebe's willingness to discuss her experience openly has already made a difference to some people.
I believe people in our region have every right to expect to be heard and to have services delivered to them, and I will continue to work as hard as I have since 2009 to make sure we are not ignored."
Sarah Richards' full statement: "While we weren't able to claim victory, the Macquarie result was amazing. We may now be the most marginal seat in Australia. There can be no complacency about the outcome. Our local campaign was successful because we resonated strongly with the community, with almost 45% of the electorate giving their first preference to the Liberal Party.
I would like to thank everyone in Macquarie that believed in me and our vision. When I was out speaking with people over the last few months, they would talk to me about their hopes and aspirations for their families, their kids, and our area. That is what I worked for. And that is what I will continue to keep working for.
I have made a commitment to this community and I will continue to give voice to the issues people have right across this region, I will be the voice that will continue to champion Coalition Government investment in infrastructure and social needs. And we will be the ones who deliver.
I love this community and I will continue to be a present and persistent advocate."