Australia's former ambassador to Israel, Dave Sharma, has emerged the victorious Liberal candidate for Wentworth after a marathon meeting of pre-selectors that ran until 1.30am on Friday morning.
Mr Sharma beat out seven other candidates, including Katherine O'Regan, who was reportedly Prime Minister Scott Morrison's favoured candidate.
The prime minister was understood to be pushing Wentworth members to back a female candidate. Some showed the party might do better with a woman in the seat.
Mr Morrison wrote a "big congratulations" to Mr Sharma on Friday morning, praising a "quality guy with extensive experience and capability".
He went on to downplay his reported advocacy for a female candidate.
"The best candidate won. That’s how it should be. Of course I want to see more Liberal women in Parliament," Mr Morrison wrote on Twitter.
"But I always want to see the best candidate selected. That’s what members rightly decided last night. Thank you and well done to the selectors and a very big congratulations to David. Welcome to the team."
Mr Sharma had the support of former prime minister Malcolm Turnbull, who was a popular MP in the seat and increased the Liberals' margin. Another former prime minister, John Howard, was reportedly also supporting Mr Sharma's bid.
Mr Turnbull tweeted his own congratulations, praising Mr Sharma's background in diplomacy.
"As a diplomat Dave has represented Australia magnificently overseas, and now if elected will make a great contribution in our national parliament," Mr Turnbull wrote.
Mr Sharma will be under pressure to hold the traditionally safe Liberal seat in Sydney.
Early polling suggests the Liberals will face a big swing against them, with voters unimpressed by the recent leadership turmoil and the dumping of their local MP from the leadership.
A loss in Wentworth would cost the Morrison government its slim one-seat majority in the House of Representatives, meaning it would rely on independent crossbenchers to guarantee supply and confidence.
Already, outspoken Queensland MP unless the government addresses his policy concerns.
Scores of party faithful filed into the Eastern Suburbs Rugby Union Club in Rose Bay to vote on the pre-selection and did not come out again for seven hours.
"We have a tough fight ahead of us to hold onto this seat, but I'll be throwing my all into it and I believe we can retain it and retain a Liberal government in Canberra," Mr Sharma told reporters.
Mr Sharma is understood to have come under pressure to pull out of the race as some within the party pushed for a woman to be selected.
But Mr Turnbull reportedly called Mr Sharma from New York and urged him to stay in the race.
Mr Bragg quit the race on Monday, saying he hoped it would pave the way for a woman. It is also understood he agreed to pull out in exchange for a safe spot on the party's Senate ticket.
Same sex marriage campaigner and City of Sydney councillor Kerryn Phelps is still considering a tilt at the seat as an independent, but is yet to confirm her run.
Pre-selection candidate and former member for Wentworth Peter King said he respected the party's decision.
"The decision was made on the merits and that's the way it should be," Mr King told AAP as he left the rugby club.
Labor has selected businessman and Tamarama Surf Lifesaving president Tim Murray to run in the seat.
Mr Morrison said pre-selectors had a very important job, given the "very difficult" circumstances around the by-election.
"I think this is going to be a very close fight," he told reporters on Thursday.
The by-election will be held on October 20.
- with AAP