PORT MORESBY, Papua New Guinea (AP) _ The Cabinet today chose a caretaker prime minister to replace Sir Julius Chan, who resigned after a deal to hire foreign mercenaries to quash a rebellion led to riots and an army mutiny.

John Giheno, the mining and petroleum minister, will serve as prime minister until June 14 elections in this Pacific country off northern Australia.

Chan said he resigned to preserve peace and order. He also stepped down so an independent judicial inquiry could be conducted into his government's $36 million contract with the British mercenary firm Sandline International to end a 9-year-old rebellion on Bougainville island.

Finance Minister Chris Haiveta and Defense Minister Mathias Ijape also resigned.

When details of the mercenary contract leaked out, soldiers revolted, angry that the government was spending millions on the foreign fighters when the army was underpaid and poorly equipped. Civilians joined them, protesting what they saw as government mismanagement and corruption.

The Bougainville rebellion began in 1988 as an environmental protest, then escalated into a guerrilla war to secede from Papua New Guinea. About 1,000 people have died in the fighting.

Giheno said he hoped to give the prime minister's job back to Chan if he is exonerated by the inquiry. If Chan is cleared of wrongdoing ``he's back,'' Giheno told reporters.

Giheno, 47, is a former high school science teacher from the coffee plantation town of Goroka in the highlands of Papua New Guinea, a remote area opened to the modern civilization by Christian missionaries and gold prospectors in the 1930s.

He is expected to bring stability to the coalition government because he has good contacts with all factions in the current controversy. He has held a number of positions, including that of foreign affairs minister.

One of Giheno's main tasks will be to begin repairing relations between the government and the military, including former its commander Brig. Gen. Jerry Singirok.

Singirok was fired by Chan and accused of treason for ordering his troops to detain and deport the hired fighters.