(CNN) -- The president of Fiji on Saturday defied a court ruling that had declared the Pacific nation's military government illegal, swearing in as prime minister a man in direct opposition to the ruling, the state-run Web site said.
Thursday's appeals court decision said President Ratu Josefa Iloilo had to appoint someone as caretaker prime minister, though that person could not be Prime Minister Voreqe Bainimarama or former Prime Minister Laisenia Qarase. But on Saturday, Iloilo swore in Bainimarama back into the same job.
Iloilo's move followed his actions Friday, which included annulling the country's constitution, firing all judges and declaring himself the head of state after the court ruling.
Iloilo was to swear in his Cabinet ministers later Saturday, according the government Web site.
Ordinarily, the position of president is ceremonial. He is appointed by a traditional chiefs' council. He then appoints the prime minister, who effectively runs the country.
But Iloilo said his decision to take over was prompted by the court ruling, which said the military government that assumed power after a 2006 coup was illegal. That decision meant that Prime Minister Bainimarama had to step down.
Bainimarama is also the country's military chief. He led the 2006 coup that deposed then-Prime Minister Qarase.
In response to the court ruling saying that Iloilo had to appoint someone as caretaker prime minister, but not Bainimarama or Qarase, Iloilo said in an address Friday: "There is no written provision in the constitution for appointing such a third party. The end result of all this is that Fiji has not, in practical legal terms, had a government in place since 3 p.m. yesterday afternoon."
"My fellow citizens, you cannot have a country without a government," he added. "The machinery of the state, like any other country, needs to be in place all the time."
Iloilo then said he would appoint an interim government and invite "suitable individuals" to join or rejoin the court benches. He also set an election deadline for 2014.
Bainimarama, with the support of the army, ousted Qarase after accusing his government of corruption. The coup was the nation's fourth since independence from Britain in 1970.
The country's high court ruled the interim government was legal, prompting Qarase to file a case with the appeals court.
The appeals court overturned the high court's decision, citing the constitution.