The magistrate arrested in a drug bust on Wednesday alleged a police conspiracy against him to get him fired.
Gaaf Dhaal Atoll Thinadhoo magistrate Ibrahim Rasheed was arrested from the island late last month. Police had said the magistrate was believed to be intoxicated and drugs had been found near the area from where he was arrested.
However, the High Court had ordered the magistrate’s release after he was produced to extend his remand.
During the first hearing of the appeal being heard by the full bench of the country’s top court, Rasheed said police had taken him into custody in 2013 and 2015 over false drugs allegations.
He told the Supreme Court bench that the police had planted the drugs near him while he was being searched.
Prosecutors meanwhile refuted the magistrate's claim and insisted that the arrest had to be made in violation of the judicature Act due to lack of time.
According to the Judicature act, unless a judge is caught in the act of committing a crime, judges can only be arrested with a warrant from a higher court than the one he or she serves.
Despite his release, Rasheed has been suspended by the judicial watchdog.