After months of angry demands for Sri Lanka's president to stand down, protesters laughed, took selfies and treated themselves to a swim as they suddenly found themselves inside his home.

The presidential palace in Colombo was overrun by hundreds of people on Saturday, capping months of public discontent over the island nation's crippling economic crisis.

President Gotabaya Rajapaksa had fled just moments earlier, assisted by troops who fired into the air to clear his escape.

Once he had left, the mood inside the compound was festive, as the crowd set aside the frustrations of long-running food and fuel shortages, as well as a tense confrontation with security forces earlier in the day.

Sri Lankan protesters enjoy a swim after storming the official residence of President Gotabaya Rajapaksa Saturday
Sri Lankan protesters enjoy a swim after storming the official residence of President Gotabaya Rajapaksa Saturday AFP

"We are in Gotabaya's room, this is the underwear he left behind," one young man said while holding up black briefs on a live video shared on multiple social media channels.

"He has left his shoes behind too."

On the grounds of the compound, dozens of men shed their shirts and jumped into the presidential pool, with some doing summersaults and frolicking in the water.

Hundreds of others sat down on carefully manicured lawns for a break from the morning's confrontation with police officers, who had fired barrages of tear gas and water cannon at demonstrators.

The storming of the presidential palace followed confrontations with police earlier in the day
The storming of the presidential palace followed confrontations with police earlier in the day AFP / STR

The crowd had managed to work their way into the compound after dismantling barricades and scaling its high gates with the help of a captured police truck.

As the protesters surged forwards, the police officers and army troops guarding the residence melted away.

Elite police officers remained stationed inside but made no attempt to remove the intruders roaming leisurely through the mansion.

Some of the crowd took turns lounging on Rajapaksa's king-size bed and the comfortable sofas.

Protesters are seen on the balcony of the presidential palace on Saturday
Protesters are seen on the balcony of the presidential palace on Saturday AFP

Protesters also helped themselves to the presidential pantry, with snacks and soft drinks seen spread out on counter tops.

"I was surprised to see that an air conditioner was working in his bathroom. We have to put up with endless blackouts," a man who entered the palace told AFP by telephone.

As they marched in, a university student climbed a gate post and loudly urged the throng not to vandalise or loot the state residence, which is home to a repository of priceless artefacts.

"We called Gota a thief and got him out, please do not remove anything from the palace," he said.

"We should not be thieves like the Rajapaksas."

The presidential palace was formerly known as the "Queen's House", and was the official residence of British governors until Sri Lanka won independence in 1948.

Since then, it has been the official residence of Sri Lanka's heads of state -- but many past leaders have believed it to be haunted.

Rajapaksa moved there in April, soon after thousands of protesters attempted to invade his private home during a major demonstration.

That residence was not overrun, but he moved to the presidential palace in the ultimately futile hope that it would be safer.