Labor's Susan Templeman claimed victory in the nail-biting race for Macquarie on Monday.
The incumbent MP edged out her Liberal opponent Sarah Richards on the final day of main counting, finishing 349 votes ahead with only hundreds left to count.
This was enough to seal victory - 16 days after the federal election - ensuring the Morrison Government will have a slim one-seat majority.
Ms Templeman issued a statement at 4pm on Monday, saying: "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."
But she acknowledged the tightness of the contest and the strong split in the electorate between the Labor-voting Blue Mountains and Liberal stronghold in the Hawkesbury.
"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," she said.
Sarah Richards issued a statement on Tuesday morning, thanking "everyone in Macquarie that believed in me and our vision".
Conceding she was unable to claim victory, she still declared "our local campaign was successful because we resonated strongly with the community, with almost 45 per cent of the electorate giving their first preference to the Liberal Party".
"I love this community and I will continue to be a present and persistent advocate," she said.
The Hawkesbury councillor had attended the Coalition party room meeting in Canberra last Tuesday, 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 attendance, 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."
New Labor leader Anthony Albanese was quick to congratulate Ms Templeman, tweeting that she was "a smart, talented, hard working MP who will play an important role in the Australian Labor team".
Senior Labor frontbencher Tanya Plibersek also celebrated the result.
"Macquarie is lucky to have a representative as smart, passionate and dedicated as you. Looking forward to having you back in Parliament," she tweeted.
Locally, Blue Mountains mayor Mark Greenhill also congratulated Ms Templeman on her re-election.
"Susan Templeman has always put community ahead of politics," he said.
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."