The Sri Lankan president’s decision to dissolve parliament and call snap elections, his latest attempt to blast a political rival from the prime minister’s office, will be challenged in the country’s supreme court.

A political crisis in the Indian ocean nation deepened on Friday night when Maithripala Sirisena announced he was dissolving parliament, which opponents said was an illegal order.

A fortnight ago Sirisena purportedly dismissed the country’s prime minister, Ranil Wickremesinghe, and replaced him with the former president Mahinda Rajapaksa. But the attempted switch failed after Rajapaksa’s forces failed to convince enough MPs to join their new coalition – prompting Sirisena to gamble on fresh polls.

The announcement has been condemned by foreign missions in Colombo and labelled unconstitutional by Sirisena’s opponents.

Mangala Samaraweera, the finance minister in Wickremesinghe’s cabinet, said the president had “kicked the constitution in the teeth”.

“We will go to the courts,” Samaraweera said in Colombo. “We will fight in the courts, we will fight in parliament and we will fight at the polls.”

The supreme court challenge will begin on Monday.

Sirisena had appeared to prepare the ground for fresh elections in past days, announcing he had taken over the country’s police department and the state printer, giving him control of the publication of decrees and proclamations.

He also appointed new ministers – giving them access to official resources in the run-up to any vote. If given legal go-ahead, new elections would be held on 5 January.

The US state department condemned the announcement. “The US is deeply concerned by news the Sri Lanka parliament will be dissolved, further deepening the political crisis,” it said in a statement.

“As a committed partner of Sri Lanka, we believe democratic institutions and processes need to be respected to ensure stability and prosperity.”

Australia also expressed its “concern and disappointment”. “We believe this action undermines Sri Lanka’s long democratic tradition and poses a risk to its stability and prosperity,” the country’s foreign minister, Marise Payne, said.