COLOMBO, Sri Lanka -- Sri Lankan Prime Minister Ranil Wickremesinghe said Wednesday he will step down, clearing the way for Parliament to choose a prime minister to work with newly elected President Gotabaya Rajapaksa.

Wickremesinghe said he will submit his resignation to the president on Thursday.

Soon after the announcement, Rajapaksa named his brother, former President Mahinda Rajapaksa, as the next prime minister.

Pro-Rajapaksa lawmaker Keheliya Rambukwella said he will be sworn in Thursday.

“Even though we have a parliamentary majority we accept the mandate received by Mr. Rajapaksa and have decided to make way for him to form a government of his preference,” Wickremesinghe said in a statement.

“I value democracy, respect democracy and act democratically,” he said.

The move clears the first hurdle for Rajapaksa in appointing his own Cabinet. Under the constitution, Wickremesinghe could continue as prime minister until March, when the president can legally dissolve Parliament.

Wickremesinghe initially wanted an early general election but his party opposed it, saying a vote soon after its presidential defeat could further erode its support.

Rajapaksa can now appoint a caretaker government, dissolve Parliament next March and force new elections, or wait until next August when Parliament's term ends.

Wickremesinghe's political future is clouded in uncertainty with strong calls for him to resign as leader of the United National Party, a position he has held for 25 years.

Wickremesinghe has been sworn in as prime minister five times over eight years but has never been able to complete a full term.

He was last elected prime minister in 2015 and was sacked by former President Maithripla Sirisena last year, only to be reinstated by a court order. Mahinda Rajapaksa was named prime minister at that time but he failed to secure a majority in Parliament.

Rajapaksa won last Saturday's presidential election, beating Sajith Premadasa, the candidate of Wickremesinghe's party.