Papua New Guinea's highest authority has reinstated as prime minister veteran leader Sir Michael Somare, one of two men claiming to hold the post.
The governor general, who represents head of state Queen Elizabeth II, backed an earlier court ruling supporting Sir Michael's claim.
His rival, Peter O'Neill, is still refusing to accept the decision.
The political crisis flared when Sir Michael returned from Singapore after recovering from serious illness.
During Sir Michael's absence, Mr O'Neill had been installed as prime minister.
But this week the country's supreme court ruled the takeover illegal, and the governor-general has now backed that decision.
Sir Michael, who is trying to cobble together a cabinet meeting in government offices in the capital Port Moresby, said in a statement that he was confident "common sense will prevail".
"I commend the public for not following any camp and staying neutral thereby keeping the peace in our capital," he said.
However, analysts say the crisis is not yet over.
Mr O'Neill and his supporters are sitting on the government benches in parliament, insisting that they are in charge of the country.
Many of Sir Michael's former ministers defected to Mr O'Neill, and he appears to have a more support among MPs than Sir Michael.
A parliamentary motion passed during a sitting attended only by his backers demanded that the governor-general come to parliament and install Mr O'Neill as prime minister.
His supporters had earlier tried to storm the governor-general's residence, but were repelled by members of the security forces.
Witnesses say the security officers are supporters of Sir Michael and that there is evidence of factions in the police.
Politicians in the region have appealed for calm in Port Moresby, a city plagued by violence.
So far there have not been any reports of serious unrest, and the army has ruled out a coup.