The Social Democratic Liberal Party (SODELPA) announced on Tuesday it had decided to form a coalition with Sitiveni Rabuka's People's Alliance and the National Federation Party.
The decision came after two days of deliberations and rival presentations by former Prime Minister Bainimarama and the People's Alliance party, after a national election last week resulted in a deadlock.
At a livestreamed news conference, Rabuka thanked the people of Fiji.
"They have voted for change and we have given them that," he said.
National Federation Party leader Biman Prasad told reporters: "Today the leaders of the People's Alliance party, the National Federation Party and the Social Democratic Liberal Party agreed to form a new government."
He said Rabuka would become the new prime minister of Fiji under the deal, and a "strong and united coalition government" was a Christmas present to the people of Fiji.
A Pacific trade and transport hub with a population of 900,000, including a sizeable Indian ethnic group, Fiji had a history of military coups until the constitution was changed in 2013 to remove a race-based electoral system.
Bainimarama, who came to power in a 2006 coup, won democratic elections in 2014 and 2018.
Bainimarama had a high international profile for climate change advocacy and has been chairman of the Pacific Islands Forum, the regional diplomatic bloc, as it sought this year to manage rising security tensions between the United States and China.
Rabuka is also a former prime minister and former coup leader.
(Reporting by Kirsty Needham, Editing by Ed Osmond and Jacqueline Wong)
Fiji’s Frank Bainimarama (C) arrives to vote at the Yat Sen Secondary School polling station during the Fijian election campaign in Suva, Fiji, 14 December 2022. EPA-EFE/MICK TSIKAS AUSTRALIA AND NEW ZEALAND OUT