The High Court in Solomon Islands is due to rule tomorrow on the validity of prime minister Manasseh Sogavare's initial nomination to contest the top job.
Listen to more on Dateline Pacific
Yesterday Mr Sogavare successfully contested the prime ministerial election and he has since been sworn in as the new leader of Solomon Islands.
This makes him the first MP since independence to win the prime ministership four times.
"This is the day the nation has been looking forward to. It is also the day that our churches our people have been praying about. And God has delivered this outcome," Manasseh Sogavare said on the steps of parliament shortly after he was announced as the next prime minister of Solomon Islands.
But his victory was steeped in controversy and major unrest broke out in the capital Honiara shortly after his acceptance speech.
The unrest continued for most of the afternoon with rioters and looters causing significant damage to shops and businesses across the city. And although police were able to shut most of it down by nightfall they were still dealing with pockets of resistance in the early hours of Thursday morning.
There are still conflicting views on how much of the unrest was a true revolt against Mr Sogavare's victory, which signifies a continuation of the last government, and how much of it was just opportunists capitalising on the charged atmosphere.
But a lot of uncertainty in the lead up to the election centred around a lawsuit filed by the rival prime ministerial candidate Matthew Wale against Mr Sogavare.
Matthew Wale told Connect News he was challenging the validity of Mr Sogavare's nomination for prime minister based on the late registration of his political party.
"The case that I lodged was significant for clarifying the application of the laws relating to the nomination and election of the prime minister," Matthew Wale said.
But a constitutional lawyer in Solomon Islands, Charles Ashley, believes Mr Wale might have left it too late to make the challenge.
"What I believe Matthew Wale should have done was before Sogavare was nominated that was the time that he could have asked the High Court to rule on Sogavare's eligibility to be a candidate," Charles Ashley said.
The conflict or confusion is centred around a piece of legislation called the Political Parties Integrity Act which was designed to try and strengthen Solomon Islands political party systems and reduce instability.
It was passed by parliament despite the absence of crucial constitutional amendments to render it fully effective.
Further complicating Manasseh Sogavare's election as prime minister was a court order obtained by Matthew Wale and delivered to the governor general Sir Frank Kabui just before Wednesday's election calling for the postponement of the process pending the High Court ruling tomorrow.
Sir Frank chose to ignore the court order and proceeded with the election prompting Mr Wale and his counterparts to stage a walkout claiming the governor general's action was illegal.
"The walkout therefore is for the sake of the rule of law. That the Governor General did not abide by the direction to defer the meeting. A direction of the High Court," Matthew Wale said.
But Mr Ashley believes Sir Frank was actually acting within the law as the Solomon Islands constitution provides special protections for the governor general and his running of the election of the prime minister.
"Schedule two of the constitution says even the courts, you cannot look into what the determination, the deliberation that has been taken by the Governor General," Mr Ashley said.
Mr Ashley believes even if the High Court were to rule Mr Sogavare's nomination for prime minister invalid based on the Political Parties Integrity Act it would be rendered ineffective by the constitution which says any MP can be nominated for the prime minister's post.
Meanwhile, an uneasy calm has settled over the capital Honiara after Wednesday night's unrest.
The Police Commissioner Matthew Varley has said the situation is now under control and he is urging residents of the capital to go about their daily lives.
So far 50 people have been arrested in connection to the unrest.
The National Referral Hospital has also seen an influx of patients seeking medical attention for cuts and bruises.
One doctor has condemned the violence saying a young boy has lost an eye as a result of the lawlessness.