COLOMBO, July 13 (Reuters) - Sri Lankan President Gotabaya Rajapaksa fled the country early on Wednesday, two sources told Reuters, hours before he was due to step down amid widespread protests over his handling of a devastating economic crisis.

Rajapaksa, his wife and two bodyguards left aboard a Sri Lankan Air Force plane, an immigration official told Reuters.

A government source said he left for the city of Male, the capital of the Maldives. The president would most likely proceed to another Asian country from there, the source said.

The immigration official said authorities could not under law prevent a sitting president from leaving the country.

Rajapaksa was due to step down as president on Wednesday to make way for a unity government, after thousands of protesters stormed his and the prime minister's official residences on Saturday demanding their ouster.

The president has not been seen in public since Friday. Parliament will elect his replacement on July 20.

The Rajapaksa family, including former prime minister Mahinda Rajapaksa, has dominated the politics of the country of 22 million for years and most Sri Lankans blame them for current problems.

The tourism-dependent economy was hammered badly by the COVID-19 pandemic and a fall in remittances from overseas Sri Lankans, while a ban on chemical fertilisers damaged farm output. The ban was later reversed.

The Rajapaksas implemented populist tax cuts in 2019 that affected government finances while shrinking foreign reserves curtailed imports of fuel, food and medicines.

Petrol has been severely rationed and long lines have formed in front of shops selling cooking gas. Headline inflation hit 54.6% last month and the central bank has warned that it could rise to 70% in coming months.

Mahinda Rajapaksa, the president's brother, resigned as prime minister in May after protests against the family turned violent. He remained in hiding at a military base in the east of the country for some days before returning to Colombo.

In May, the Rajapaksa government appointed Mohammed Nasheed, the speaker of the Maldives parliament and a former president, to help coordinate foreign assistance for crisis-hit Sri Lanka.

The same month, Nasheed publicly denied allegations that he was helping Mahinda Rajapaksa secure safe haven in the Maldives.