Updated

Sri Lankan President President Gotabaya Rajapaksa and Prime Minister Ranil Wickremesinghe have both agreed to resign after thousands of demonstrators stormed the president's residence to protest a crippling economic crisis in the South Asian nation.

Protesters in the city of Colombo barged through police barricades and stormed the president's residence and office on Saturday, and targeted the prime minister's private residence, setting it on fire, according to reports.

Mahinda Yapa Abeywardena, the speaker of Sri Lanka’s Parliament, said Rajapaksa agreed to resign effective Wednesday.

Earlier, protesters carried Sri Lankan flags and helmets as they broke in to Rajapaksa's residence, sitting on beds and swimming in a pool. "The president was escorted to safety," a senior defense source told AFP. 

Sri Lanka protesters who stormed the president's residence swim in a pool

Protesters demanding the resignation of Sri Lanka's President Gotabaya Rajapaksa swim in a pool inside the compound of Sri Lanka's Presidential Palace in Colombo on July 9, 2022.  (AFP via Getty Images)

Sri Lanka protesters who stormed the president's residence sit on a bed

Demonstrators protest inside the President's House, after President Gotabaya Rajapaksa fled, amid the country's economic crisis, in Colombo, Sri Lanka, in this screengrab obtained from social media video on July 9, 2022. News Cutter via REUTERS (News Cutter via REUTERS)

The country, consisting of about 22 million, is suffering from a severe foreign exchange shortage, which has limited essential imports of fuel, food and medicine. This shortage has pushed the island into its worst financial situation in 70 years.

"To ensure the continuation of the Government including the safety of all citizens I accept the best recommendation of the Party Leaders today, to make way for an All-Party Government," Wickremesinghe tweeted. "To facilitate this I will resign as Prime Minister."

Rajapaksa has been blamed by many for the country's economic decline. Protests have taken place since March in which demonstrators have demanded the president's resignation. Saturday's protest is believed to be one of the biggest anti-government marches this year.

CHINA: KNIFE ATTACK AT SHANGHAI HOSPITAL LEAVES FOUR INJURED

Video from Sri Lankan media outlets showed protesters storming into the president's residence.

Sri Lanka protests

Protesters try to remove a tear gas shell after it was fired by police to disperse them in Colombo, Sri Lanka, Saturday, July 9, 2022. Sri Lankan protesters demanding that President Gotabaya Rajapaksa resign forced their way into his official residence on Saturday, a local television report said, as thousands of people took to the streets in the capital decrying the island nation's worst economic crisis in recent memory. (AP Photo/Amitha Thennakoon)

Sri Lankan protesters demonstrate outside president's office in Colombo

Protesters, many carrying Sri Lankan flags, gather outside the president's office in Colombo, Sri Lanka, Saturday, July 9, 2022.  (AP Photo/Thilina Kaluthotage)

According to a witness, thousands of demonstrators forced their way into Colombo’s government district, breaking multiple police barricades before reaching Rajapaksa’s residence.

Police fired shots in the air but failed to halt the protestors from surrounding the president's house, the witness said.

NHL DRAFT: THREE RUSSIANS SELECTED IN 1ST ROUND AMID CONCERNS

Sri Lanka

Police use water canon and tear gas to disperse the protesters in Colombo, Sri Lanka, Saturday, July 9, 2022. Sri Lankan protesters demanding that President Gotabaya Rajapaksa resign forced their way into his official residence on Saturday, a local television report said, as thousands of people took to the streets in the capital decrying the island nation's worst economic crisis in recent memory. (AP Photo/Amitha Thennakoon)

A severe shortage of fuel on the Asian island has stalled transportation services, but demonstrators still rode on buses, trains and trucks from different areas of the country to reach Colombo to protest the government’s economic failures.

The impoverished country in recent weeks has stopped receiving fuel shipments, which has forced school closures and limited petrol and diesel for services deemed essential.

WEST VIRGINIA DETECTS FIRST PROBABLE CASE OF MONKEYPOX

Sri Lanka

A man throws back a tear gas shell after it was fired by police to disperse the protesters in Colombo, Sri Lanka, Saturday, July 9, 2022. Sri Lankan protesters demanding that President Gotabaya Rajapaksa resign forced their way into his official residence on Saturday, a local television report said, as thousands of people took to the streets in the capital decrying the island nation's worst economic crisis in recent memory. (AP Photo/Amitha Thennakoon)

The country has been hit with massive fuel shortages and high inflation levels. Sri Lanka's inflation hit 54.6% in June.

Political instability could hurt Sri Lanka’s discussions with the International Monetary Fund, from which they seek a $3 billion bailout, a restructuring of some foreign debt and fund-raising from multilateral and bilateral sources to soften the burden of the worsened dollar scarcity.

CLICK HERE TO GET THE FOX NEWS APP

Reuters and The Associated Press contributed to this report.