Colombo: Sri Lanka's newly elected President Gotabaya Rajapaksa on Thursday swore in his elder brother, former president Mahinda Rajapaksa, as Prime Minister, cementing the powerful family's political comeback.

The appointment of Mahinda Rajapaksa, 74, came hours after the former premier Ranil Wickremesinghe tendered his resignation following the defeat of his party's candidate in a presidential election to Gotabaya Rajapaksa over the weekend.

Sri Lanka's President Gotabaya Rajapaksa, right, greets his brother Mahinda after appointing him as Prime Minister on Thursday. Credit:AP

It is the first time in Sri Lankan history that two siblings have held the two top political positions, although Mahinda is only in charge of a caretaker government until parliamentary elections next year.

In a ceremony in the capital Colombo on Thursday, Gotabaya swore in his brother as their respective wives, sons and daughters-in-law looked on.