A teen was arrested on a charge of assault after being accused of being involved in a gang fight, according to police in the Maldives.

Gan police said that they have arrested 19-year-old Ali Thasmeen, after being accused of violence during a late night street fight.

He was booked into jail before being brought to the Gan Magistrate Court for a bail hearing. The court freed Thasmeen from jail on condition that he go fishing to earn a living and pray at a mosque of his choice.

He was also ordered to stay at home between 10:00 p.m. and 7:00 a.m. After the ruling was made public, several lawmakers criticized the court, saying that it has overstepped its authority.

Maldivian Democratic Party member Fayyaz Ismail said that judges cannot order anyone to go fishing as a condition of being released from jail.

He also criticized instructing the teen to attend a mosque for prayers, saying that it might be fine with a Sharia court, but not at a magistrate court.