The new Cook Islands prime minister is Jim Marurai from the minority Demo Tumu party.
Mr Marurai, the former minister of education, was voted in by 14 votes to 9, confirming that the coalition deal between the Demo Tumu party and the Cook Islands Party, has held.
The opposition Democratic party did not put forward a candidate.
Our correspondent, Jason Brown, was at parliament when Mr Marurai was elected, and he says a clear reference to the coalition deal on power sharing was made by the new prime minister.
"Jim Marurai told parliament that he was proud to be given this opportunity to lead the country for the next two years. He did not go on and say who would be leading the country for the remaining two years of the parliamentary four year term but the clear inference is that his coalition partner, Sir Geoffrey Henry, would probably take that role over."
Jason Brown reporting from Rarotonga.
The new speaker of parliament is a former MP, Norman George.