The ruling comes a week after Premier Dave Hancock announced changes will be made to the Vital Statistics Act.
The law states that transgender persons must have reassignment surgery before they can change the sex on their birth certificates. Hancock said the surgery requirement will be dropped, but there is no word on when that might happen.
Justice Brian Burrows said the government has 30 days to issue a new birth certificate to a 23-year-old transgender woman who filed the legal challenge.
Representing herself in court, the woman argued that she needs to have her birth certificate switched from male to female so she can move on with her life. She said she doesn't want to have surgery and the birth certificate she has now makes her feel like "a second-class citizen, undeserving of having my identity as female recognized."
He also ruled the current legislation violates the Constitution and can no longer be in force.
"Transgendered persons encounter disadvantage, prejudice, stereotyping and vulnerability because their felt sex is not the sex recorded at birth," he wrote in his decision.
He said the law, as it stands, contributes to the prejudice.
"When asked, at the presentation of this application, how it could possibly matter that a person born male, but who has transitioned and lives female, have a birth certificate that says they are female, counsel for Alberta could offer no answer."
A spokeswoman with Service Alberta, Jessica Johnson, said the judge's ruling will be respected and the woman will receive a new birth certificate by the judge's deadline.
Johnson said details of the new legislation are still being worked out.
Human rights complaints have been filed in at least four provinces — Alberta, Saskatchewan, Manitoba and British Columbia — calling for changes to such laws.
In British Columbia, a bill was recently introduced that would remove the condition that a person must first have sex reassignment surgery. It would also allow children, with parental consent, to switch the sex listed on their birth certificates.
In 2012, Ontario's human rights tribunal declared it discriminatory to require surgery for a transgender woman who wanted to switch to female from male on her birth certificate. The province revised its legislation to allow a change with a note from a doctor or psychologist, but set an age limit of at least 18.
Also on HuffPost