Prime minister Malcolm Turnbull has survived a leadership challenge from immigration minister Peter Dutton, winning a vote in the Liberal party room 48 to 35.
After days of speculation, the prime minister called for a leadership spill during the Liberal party room at 9am on Tuesday.
Dutton stood against Turnbull for the leadership and garnered 35 votes, 13 short of Turnbull's 48.
The deputy leadership was also spilled, and foreign minister Julie Bishop was re-elected uncontested.
Following the vote, Dutton resigned from the ministry.
Sources within the Liberals told BuzzFeed News before the vote that the prime minister needed an emphatic win to shut down any future conversations about his leadership.
In a press conference on Tuesday, Turnbull said he had asked Dutton to stay on as home affairs minister, but "he said to me that he doesn't feel he can remain in the cabinet having challenged me to the leadership of the party, and so he is resigning."
Turnbull said that treasurer Scott Morrison would act as Home Affairs minister. No other ministers were resigning, Turnbull said, because it was a secret ballot, and he claimed not to know how they voted in the ballot.
The PM said that the party had to be united now.
"We know that instability undermines the ability of any government to get anything done," he said. "Unity is critical. We cannot allow as I said in the party room today, our internal issues to undermine our work, to create a risk, a real risk, that [Labor leader] Bill Shorten will be the prime minister."
On Tuesday afternoon, assistant minister Michael Sukkar also offered his resignation to the prime minister.
Nationals MP Darren Chester was the first member of the Coalition to front the cameras following the vote, despite not attending the Liberal party room.
He described the idea of Malcolm Turnbull being a dead man walking as "ridiculous".
"I would say to my colleagues: the circus has to stop," Chester said. "There has been a vote and the prime minister won. Back the prime minister and give him an opportunity to finish the job that he started and deliver for all Australians."
Chester said he remains "extremely confident" Turnbull will lead the Coalition to the next election, and retain government.
"The people expect us to focus on them. Every minute we spend talking about ourselves and focusing on ourselves, they are switching off. Let's back the prime minister and get the job done."
Turnbull's leadership has been under intense scrutiny over the past few weeks following the Coalition's disastrous result in the Super Saturday by-elections.
The LNP secured just 30% of the primary vote in the Queensland seat of Longman, down 9% from the 2016 federal election.
If that swing is repeated at the next federal election, the Coalition could lose a handful of seats, and government.
In recent days fierce internal opposition also forced the prime minister to make a U-turn on his flagship energy policy. Up to 10 Coalition members are said to be considering crossing the floor over Turnbull's signature National Energy Guarantee policy.
BuzzFeed News spoke to Coalition conservatives – a self-described "rebel alliance" – who were agitating for a Dutton government. Disgruntled plotters were telling the press gallery in off-the-record conversations that under Dutton’s leadership the next election would be run on a platform of cheaper power bills over reducing emissions, withdrawing from the Paris climate accord, and scaling back immigration.
Leakers from the party room during the discussion claimed backbench Liberal MP Warren Entsch was applauded for slamming former prime minister Tony Abbott's "sniping" against Turnbull.
Abbott shot back after the meeting. He said in a statement: "To put the Entsch intervention into context, I had just said to the party room that exhortations from the leadership group about loyalty and unity were all very well but 'unity has to be created and loyalty has to be earned. They can't just be demanded'."