Image copyright Reuters Image caption President Sirisena's move to appoint Mahinda Rajapaksa as PM has shocked many in Sri Lanka

Sri Lanka's unfolding political crisis threatens to turn into a "bloodbath", the speaker of parliament has warned.

The warning came after President Maithripala Sirisena sacked Prime Minister Ranil Wickremesinghe and his cabinet and suspended parliament.

Mr Sirisena has appointed the man he defeated in the 2015 presidential election - former President Mahinda Rajapaksa - as the new PM.

But Mr Wickremesinghe is refusing to leave, saying the move is illegitimate.

One person was killed at the weekend when the bodyguard of the sacked oil minister fired at a crowd of protesters outside his office.

On Monday, police arrested the minister, Arjuna Ranatunga, a 54-year-old former national cricket team captain and an ally of Mr Wickremesinghe. He was later released on bail. His bodyguard has also been arrested and an investigation is under way.

President Sirisena's move has sent shockwaves across Sri Lanka.

Regional rivals are also watching events closely - China has already congratulated Mr Rajapaksa, while India, the EU and US have called for the constitution to be respected.

Sri Lankan parliament Speaker Karu Jayasuriya, who has urged Mr Sirisena to reconsider his decision to suspend parliament, told reporters on Monday: "We should settle this through parliament, but if we take it out to the streets, there will be a huge bloodbath."

What's going on?

Mr Sirisena, the president, and Mr Wicremesinghe, the sacked prime minister, joined forces in the 2015 election to defeat the then long-time president, Mr Rajapaksa.

But their uneasy coalition has since fractured and on Friday, President Sirisena said he was sacking the PM and replacing him with Mr Rajapaksa. He also suspended parliament until 16 November.

This has left the country with two people claiming to run the government. The ousted PM has refused to leave his residence, Temple Trees, arguing the president's move is unconstitutional and calling for parliament to be convened quickly so a vote can take place.

On Monday a spokesman for Mr Rajapaksa told the BBC they were giving him more time to leave of his own accord.

In the meantime, however, Mr Rajapaksa has sworn in a new cabinet and he has also taken the post of finance minister. Four MPs aligned with Mr Wickremesinghe were given ministerial portfolios in a bid to win their support in parliament.

The country, meanwhile, is divided, and the constitutional legitimacy of what has happened remains unclear.

Image copyright AFP Image caption Supporters have gathered outside Mr Wickremesinghe's residence

What's behind President Sirisena's actions?

Mr Wickremesinghe helped the president triumph in the 2015 poll, but the pair reportedly clashed in cabinet recently over government plans to lease a port to India.

President Sirisena said on Saturday that there had been big differences over policy with Mr Wickremesinghe for more than three years.

He linked Mr Wickremesinghe to a controversial central bank bond sale, which is alleged to have led to the loss of 11bn Sri Lankan rupees ($65m; £50m).

The president also alleged that a cabinet minister was involved in a plot to kill him and that police had obstructed an investigation.

Image copyright Reuters Image caption Mr Sirisena insisted that replacing his PM was not unconstitutional

All this meant the "only alternative" was to appoint Mr Rajapaksa - his former ally turned rival - as PM, Mr Sirisena said.

For his part, Mr Rajapaksa hailed a "new democratic beginning and the rejection of the politics of hate".

Who is Rajapaksa?

Mahinda Rajapaksa is a popular but controversial figure. As president, he ended the decades-long civil war in 2009, but faced criticism for the means by which he achieved victory - many thousands of Tamil civilians are thought to have been killed by government forces in the final months of the fighting.

The military has always denied this, but it has remained a bitterly contentious issue and been the subject of intense scrutiny.

Image copyright Getty Images Image caption Mr Rajapaksa has been accused of massive corruption and atrocities during the country's civil war

Mr Rajapaksa also signed several large infrastructural deals with China when he was in office - saddling Sri Lanka with billions of dollars in debt. The former president and his inner circle are also accused of corruption, which they deny.

Many in Sri Lanka are now worried about the fate of corruption cases targeting members of the Rajapaksa family, along with investigations into the murders of journalists and others under Mahinda Rajapaksa's 2005-2015 presidency, correspondents say.

What other signs of tension are there?

Rival groups supporting Mr Rajapaksa and Mr Wickremesinghe have been gathering at different locations in Colombo. Mr Rajapaksa's supporters have taken over Sri Lankan state media and other state institutions.

Trade unions linked to Mr Rajapaksa's party have also been blocking access to ministers who are from Mr Wickremesinghe's party.

Meanwhile hundreds of Wickremesinghe supporters have gathered around Temple Trees and say they will stay there to protect the ousted PM.

The PM and his United National Party (UNP) came to power promising accountability for alleged atrocities committed in Sri Lanka's civil war and during Mr Rajapaksa's period as president.

Over the 26-year conflict, between 80,000 and 100,000 people are estimated to have died, with both sides alleged to have perpetrated war crimes.