Updated: 10:30 p.m. EDT

HARRISBURG, Pa. — Pennsylvania’s ban on same-sex marriage was overturned by a federal judge Tuesday in a decision that legalized the practice throughout the Northeast and sent couples racing to pick up licenses.

U.S. District Judge John E. Jones III called the plaintiffs — a widow, 11 couples and one couple’s teenage daughters — courageous for challenging the constitutionality of the ban passed by lawmakers in 1996.

“We are a better people than what these laws represent, and it is time to discard them into the ash heap of history,” Jones wrote of the 1996 state ban:

“The issue we resolve today is a divisive one. Some of our citizens are made deeply uncomfortable by the notion of same-sex marriage. However, that same-sex marriage causes discomfort in some does not make its prohibition constitutional. Nor can past tradition trump the bedrock constitutional guarantees of due process and equal protection,” wrote Jones, in his decision. “Were that not so, ours would still be a racially segregated nation according to the now rightfully discarded doctrine of ‘separate but equal.’ […] “In future generations the label same-sex marriage will be abandoned, to be replaced simply by marriage.”

Jones declined to put his ruling on hold for a possible appeal by Republican Gov. Tom Corbett, so it went into immediate effect. The governor, who opposes gay marriage, did not issue a statement or indicate whether he would appeal. However, his state party chairman complained that an “activist” judge had usurped the power of the Legislature.

Amid a frenzy of celebration across the state, county offices in Philadelphia stayed open late to handle marriage applications, while officials in Pittsburgh were closed for election day but accepting them online. Couples must wait three days before getting married, unless a sympathetic judge grants a waiver.

Joe Parisi told his partner to “jet out of work” and get to Philadelphia City Hall.

“We didn’t want to take the chance of having this be challenged and missing out on our opportunity,” said Parisi, a Philadelphia resident who plans to marry Steven Seminelli.

They were among the first to get a license Tuesday afternoon, just hours after the judge’s ruling.

The judge also ordered Pennsylvania to recognize same-sex marriages performed elsewhere.

Vic Walczak, legal director of the American Civil Liberties Union of Pennsylvania, which pursued the case, said of the ruling: “It’s everything we had hoped for.”

State marriage bans have been falling around the country since the U.S. Supreme Court last year struck down part of the federal Defense of Marriage Act. If Tuesday’s decision stands, Pennsylvania would become the 19th state to legalize gay marriage, according to the advocacy group Freedom to Marry.

The ACLU had argued that the bans deprive same-sex couples and their families of the legal protections, tax benefits and social statuses afforded to married couples.

Corbett’s office was left to defend the law after Democratic Attorney General Kathleen Kane refused to do so. A spokesman for Corbett’s office said it was reviewing the opinion.

The Pennsylvania lawsuit, filed July 9, was the first known challenge to the state ban. At least five later test cases emerged, including one over a suburban county’s decision last year to issue 174 marriage licenses to same-sex couples, before a court shut them down. Officials in Montgomery County were trying Tuesday to have that order lifted.

Oregon became the 18th state to recognize same-sex marriage on Monday, when couples began applying for marriage licenses immediately after a federal judge invalidated its voter-approved ban.

Also Monday, a federal judge in Utah ordered state officials to recognize more than 1,000 gay marriages that took place in the state over a two-week period before the U.S. Supreme Court halted same-sex weddings with an emergency stay.

And later Tuesday, a federal appeals court ruled that no same-sex marriages will be allowed or recognized in Idaho until an appeal to a ruling May 13 overturning that state’s ban is decided.

Jones, a Republican and an appointee of former President George W. Bush, was previously known for a 2005 decision in which he barred a Pennsylvania school district from teaching intelligent design in biology class, saying it was “a mere re-labeling of creationism.”

The torrent of celebration from Democrats and supporters Tuesday was met by criticism from state Republicans, who as recently as 2012 endorsed a platform defining marriage as between a man and a woman.

“An activist judiciary has substituted its judgment in place of the law created by the elected representatives of Pennsylvania,” Chairman Rob Gleason said, “and has stifled the ongoing debate of people with differing points of view.”

Read the ruling and order here.

Case archives: Whitewood v. Wolf

Associated Press contributed to this report.