A district court judge in Minnesota ruled this week that transgender people on Medicaid have the right to gender reassignment surgery, lifting a decade-long statewide ban on transgender surgeries for those on Medicaid.

Ramsey County Judge William Leary granted 64-year-old Evan Thomas, who sued the Department of Human Services, the right to have gender reassignment surgery previously denied to him by state law, the Star Tribune reported.

Leary rejected the state’s claims that the coverage ban was due to budgetary constraints and that the suit was moot because changes to Medicaid at the federal level would have allowed the surgeries come January.

The American Civil Liberties Union of Minnesota (ACLU) filed the suit on behalf of Thomas and the advocacy group OutFront Minnesota.

The suit alleged that the law discriminated against transgender people because the state’s medical assistance programs refused to pay for procedures such as hysterectomies, mastectomies, vaginoplasty, and phalloplasty for those who were performing the procedures for gender reassignment, but allowed them in other medical instances.

Changes made to Obamacare in July allowed gender reassignment surgeries on state Medicaid plans and gave states until January 1 to implement the changes.

On July 1, President Obama also lifted the ban on transgenders serving in the military.

The Department of Human Services is in support of the court’s striking down of the law.

“The department has been working to provide health care services related to gender transition since a federal rule went into effect in July 2016. The district court order brings the state into compliance with this federal rule and ensures the department may provide this service to Minnesotans,” the agency said in a statement.

Thomas will now be allowed to have his double mastectomy this month, in addition to the counseling and hormone therapy he has undergone to transition into a man.

“I’m so happy we won,” he said. “The judge’s ruling is a forceful statement that transgender people deserve equal treatment under the law.”

President Obama tried to make it legal for transgenders to use whatever bathrooms they choose, but a federal judge struck down his directive in August.