A Hyderabad court on Tuesday granted bail to suspended Bharatiya Janata Party leader T Raja Singh hours after he was arrested by the police for making alleged derogatory comments about Prophet Muhammad, The Indian Express reported.

The court rejected the police’s demand for custody, saying they had not served a notice to Singh under Section 41A of the Code of Criminal Procedure before arresting him.

It also ordered Singh to be released on the condition that he would not leave the city and would seek permission from the police before stepping out of his house.

Earlier in the day, Singh was suspended from the saffron party which said in a statement that he had “expressed views contrary to the party’s position on various matters”, according to PTI.

The BJP also issued a show cause notice, asking to explain within 10 days why he should not be expelled from the party.

Large-scale protests erupted in the city late on Monday after Singh, the legislator from the Goshamahal constituency, uploaded a video on YouTube, in which he repeated suspended BJP spokesperson Nupur Sharma’s disparaging remarks about the Prophet, according to The Indian Express.

Sharma’s comments had led to a spate of violence and unrest in several parts of the country in June. It had also caused a major diplomatic row, with several Arab countries taking objection to them. The BJP was forced to suspend her.

After his arrest on Tuesday, Singh said it was a comic video posted in reaction to comedianMunawar Faruqui’s show held in Hyderabad on August 20. A day earlier, the Hyderabad Police had put Singh under house arrest after he threatened to beat up Faruqui and burn down the venue where he was scheduled to perform.

“My video was aimed at Faruqui and I stand by my words, and I did not hurt anyone’s sentiments,” the BJP leader said. “This was the first part of the video, there will be a second video too.”

Singh’s video has been removed from YouTube after it was shared widely on social media, according to reports.

“We have received several complaints,” Deputy Commissioner of Police (West Zone) Joel Davis told The Indian Express.

A first information report was registered against Singh under sections of the Indian Penal Code related to promoting enmity between different groups on grounds of religion.

Members of the All India Majlis-e-Ittehadul Muslimeem protested outside Hyderabad Police chief’s office, seeking the two-time MLA’s arrest. According to the police, over 250 protestors also gathered in front of the Dabeerpura police station in the city on Monday night, saying Singh’s video had hurt the religious sentiments of Muslims.