A Highlands MP James Marape has been elected as Papua New Guinea's prime minister.
MPs elected the Tari-Pori MP in a parliamentary vote this morning, following the resignation of Peter O'Neill as prime minister yesterday.
Mr Marape defeated former prime minister Sir Mekere Morauta by 101 votes to 8 in the 111-seat house.
In a twist, Mr O'Neill was also nominated for today's vote by the opposition leader Patrick Pruaitch who was earlier expected to be nominated himself.
Mr O'Neill initially accepted but subsequently withdrew his nomination, citing his earlier acceptance as a move to foil the opposition's apparent attempt to split the vote.
Today's vote is the culimination of a month of political ructions in Port Moresby. It was Mr Marape's resignation as Finance Minister seven weeks ago which triggered a series of defections from Mr O'Neill's party and the coalition government.
Pressure on Mr O'Neill to resign intensified last week when more key allies deserted him, and he lost his parliamentary majority after seven and a half years in power.
A flood of grievances over PNG's ailing economy, deteriorating basic services, handling of the latest LNG gas project, and festering corruption allegations have finally turned the tide against Peter O'Neill.
However, the Ialibu-Pangia MP has played a clever hand in securing he and his party's ongoing place in government.
His resignation prompted a number of MPs who had recently defected to immediately return to the ruling party whose MPs held discussions overnight with Mr Marape and his followers in the Pangu Pati.
After recently taking up the leadership of Pangu, Mr Marape has now reinstalled PNG's oldest political grouping as the ruling party after two decades as a marginal influence in parliament.
His move to the opposition last month encouraged an exodus of other government MPs, unified by the aim of removing Mr O'Neill.
Camped at Moresby's Laguna Hotel, the opposition's ranks were significantly bolstered by the defections in recent weeks.
However once Mr O'Neill stood down, the Laguna group was unable to retain the support of key groups, including the United Resources Party of William Duma, whose allegiance to the opposition was never set in concrete.
Mr Pruaitch's nomination of Mr O'Neill was a late ploy to create dissonance among the field, as it had become clear last night that Mr Marape had garnered majority support.
Ultimately, the opposition was defeated due to a surge of MPs back to team up with the rump of the goverment which many of them defected from in recent weeks.
In essence, the rump of the O'Neill-led government has merely reconfigured to remain in power with a new leader.