Ranil Wickremesinghe was sworn in Friday for a fourth term as Sri Lanka's prime minister.
Voters went to the polls Monday and rejected a bid by controversial former President Mahinda Rajapaksa to return to political power as the country's prime minister, an office that is second to the president.
Wickremesinghe's United National Party and Rajapaksa's Sri Lanka Freedom Party signed an agreement to work together in the new parliament. Details of the agreement were not immediately released.
Prime Minister Wickremesinghe's swearing-in ceremony in Columbo was broadcast live on national television.
Wickremesinghe's UNP won 106 out of 225 seats in parliament, while Rajapaksa's SLFP secured 95.
Rajapaksa had sought a third term as president in January after abolishing the two-term limit for presidents. He lost to his former health minister, Maithripala Sirisena, who vowed before Monday's election not to appoint Rajapaksa as prime minister, even if the former president secured a majority in parliament.
Political analysts said Monday's vote was essentially a referendum on Rajapaksa's popularity.
Since leaving office, the former president and some of his closest relatives are facing corruption charges.
Rajapaksa remains hugely popular among sections of the ethnic majority Sinhalese community for the crushing defeat of the Tamil guerrillas in 2009, bringing an end to their 37-year campaign for a separate homeland.
The United Nations estimates about 40,000 Tamil civilians were killed in the final phases of the civil war.
The Tamils voted en masse for Sirisena in January after boycotting previous elections, effectively blocking Rajapaksa's victory at the polls.
Security at the polls Monday was tight as tens of thousands of security forces were deployed across the country to ensure a free and fair election.