Rabuka was elected with 28 votes to 27.
"It was a very close margin," Social Democratic Liberal Party (Sodelpa) youth forum president Ben Daveta said.
From the polls to parliament, every decision was balanced on a knife's edge.
First, no party gained an outright majority to rule.
Then it took the king-makers Sodelpa two split-votes to choose a coalition partner -- and even in the final secret ballot to elect a prime minister, someone in the opposition ranks voted for the other side.
It has been a frantic time, Daveta said.