President Maithripala Sirisena on Friday night sacked Prime Minister Ranil Wickremesinghe and appointed former strongman Rajapaksa as the new prime minister. Sirisena also suspended parliament till November 16 after Wickremesinghe sought an emergency session to prove his majority.
On Sunday, Sri Lankan Parliament's Speaker Karu Jayasuriya recognised Wickremesinghe as the prime minister.
"China's Ambassador to #SriLanka Cheng Xueyuan called on newly appointed Prime Minister Mahinda Rajapaksa earlier today to convey congratulatory wishes from Chinese President Xi Jinping," Rajapaksa himself tweeted, along with a picture.
Chinese Ambassador Cheng also paid a courtesy call on UNP leader Ranil Wickremesinghe, Daily Mirror newspaper reported on Sunday.
China is investing billions of dollars in infrastructure and developments in Sri Lanka under Rajapaksa's rule. The government led by Wickremesinghe has tried to re-balance Sri Lanka's foreign relations away from China and towards India and Japan.
The Hambantota port in Rajapaksa's hometown was built by a Chinese company and funded by Chinese loans.
According to reports, Sri Lanka is now struggling to repay that money, and has signed an agreement to give a Chinese firm a stake in the Hambantota port as a way of paying down some of that debt.
Sri Lanka is strategically located on the sea route that sees oil shipments travel from the Middle East, making energy security a key reason China was keen to invest.
Sri Lanka is key to the controversial One Belt, One Road (OBOR) initiative, building road, rail and sea links to boost trade with countries around the world to increase Beijing's influence. The OBOR is a pet project of President Xi.