Sri Lanka's newly-elected president, Jutabaya Rajapakse, appointed his older brother, former president Mahinda Rajapakse, as prime minister, and was sworn in on Thursday, devoting a strong return to his family.

The appointment of Mahinda Rajapakse, 74, came a few hours after the resignation of former Prime Minister Ranil Wickremesinghe, after the defeat of his party's candidate in the presidential election won by Gotabaya Rajapakse over the weekend.

It is the first time in the history of Sri Lanka that two brothers hold the biggest posts in the country, although Mahinda holds a caretaker government until next year's parliamentary elections.

Jutabaya Rajapakse, 70, previously served as defense minister under his brother Mahinda, who held the presidency from 2005 to 2015.

Mahinda, who has been Sri Lanka's opposition leader since January, has been prime minister twice.

Mahinda is set to be his party's candidate in the parliamentary elections expected in April. Mahinda gained popularity among the country's Sinhalese majority after overseeing the end of a 26-year civil war.