Sri Lankan lawmakers say they have passed a no-confidence motion against the country’s purported prime minister, Mahinda Rajapaksa, removing the PM and his cabinet from their posts and deepening an unprecedented constitutional crisis in the country.

But allies of Rajapaksa – controversially appointed by Sirisena last month after the president sacked the incumbent PM, Ranil Wickremesinghe – say they are refusing to recognise the legitimacy of Wednesday’s vote, extending the uncertainty that paralysed the government for the past fortnight.

The drama on Wednesday morning left it unclear who, if anyone, is currently Sri Lanka’s lawful prime minister.

There were chaotic scenes on the floor of the country’s parliament during the sitting, with Rajapaksa storming out of the house and some legislators from his party storming the well of the chamber in a bid to halt proceedings.

Amid shouting, lawmakers say the parliamentary speaker, Karu Jayasuriya, announced he would take a voice vote instead. Opponents of Rajapaksa were audibly louder, and Jayasuriya declared the no-confidence motion had been carried.

But Namal Rajapaksa, an MP and son of the purported prime minister, told the Guardian his side did not recognise Wednesday’s vote. “The speaker said over the noise that he wanted us to scream to decide who’s the prime minister,” he said.

“We can’t do that. If the speaker wants to select a prime minister, then he can show 113 votes to the president and ask for it.”

Wickremesinghe, who President Sirisena has been trying to sack from the prime ministership and replace with Rajapaksa, said he had submitted a petition with the signatures of 122 MPs supporting the no-confidence measure in his opponent Rajapaksa.

“If any one wants to challenge the speaker’s decision they can put it to vote,” he said.

“We will now take steps to ensure that the government in place before the 26th Oct will continue,” he later posted on Twitter.

But it was unclear whether he had legally resumed his role as prime minister, fuelling confusion over who commands state institutions such as the police and public service.

“I wish to inform all government servants and police that you cannot carry out illegal orders from the purported government that has failed to demonstrate the confidence of the people,” Wickremesinghe said.

Anura Dissanayake, from the Janatha Vimukthi Peramuna party, said he considered both the prime minister’s seat and the cabinet empty, and called on Sirisena to appoint someone for parliament to approve.

Parliament has been adjourned until 10am on Thursday, but there are fears the assembly could be suspended before then.

At least five MPs who had previously expressed support for Rajapaksa crossed over on Wednesday morning to Wickremesinghe’s side.

Footage from outside parliament showed supporters of both sides protesting, separated by a line of riot police.

Wednesday’s events are the latest chapter in an unprecedented period of turmoil for what Sri Lankans boast is Asia’s oldest democracy.

Sirisena surprised the country on 26 October when he announced Wickremesinghe had been summarily dismissed as prime minister and that Rajapaksa was appointed in his place.

Constitutional experts queried whether the sacking was legal and Wickremesinghe demanded parliament be allowed to decide on his leadership, but was prevented from doing so when Sirisena abruptly suspended the body.

Wickremesinghe’s forces, along with civil society groups and foreign governments, have been calling for parliament to be allowed to resume. Rajapaksa, meanwhile, worked to persuade enough MPs to defect to win a confidence vote on the parliamentary floor.

Last Friday, he conceded he had failed to do so, prompting Sirisena to escalate the dispute by dismissing parliament and sending Sri Lankans to the polls.

Sirisena and Wickremesinghe’s fragile coalition has deteriorated in the past 18 months and observers argue the president was hoping to protect his job by allying himself with Rajapaksa, a former party colleague who is probably the most popular politician in Sri Lanka.

The Buddhist nationalist strongman, nicknamed “Lord of the Rings” for his taste in heavy, gem-laden jewellery, is accused of overseeing a litany of human rights abuses during his decade in power until 2015, including in the final months of the country’s brutal civil war against Tamil militants.

Sirisena’s election gambit was temporarily blocked on Tuesday evening when it was suspended by the country’s supreme court, which wants to hear a series of challenges to the order from Wickremesinghe, other parties and civil society groups.

The court’s judgment on Tuesday cleared the way for parliament to resume the following day – though the sitting has served only to exacerbate the political chaos.