India’s Supreme Court has struck down the country’s long-standing ban on gay sex. In a decision announced Thursday, all five judges who considered the case agreed that the ban should be removed. In reading the court’s decision, Chief Justice Dipak Misra said the law “had become a weapon for harassment” against members of the LGBT community. The law barring sex between members of the same sex was first introduced by India’s British colonial rulers in 1861. The criminal act was punishable by up to 10 years in prison. The law was ended in 2009 by the Delhi High Court. But it was brought back in 2013 by the Supreme Court, making India one of the few countries that outlawed gay sex. But the latest Supreme Court decision found that sexual orientation is “biological” and should not be used to discriminate.