PHILADELPHIA (AP) — Same-sex couples in Pennsylvania clamored for marriage licenses after a judge ruled to allow the state to join the rest of the Northeast in legalizing gay weddings, with Philadelphia offices staying open late to handle a rush of applications.

Under state law, couples must wait three days after their application to get married unless a sympathetic judge grants a waiver. Before three days pass after Tuesday's ruling, Republican Gov. Tom Corbett could appeal and effectively put it on hold, though he didn't immediately indicate whether he would.

Joe Parisi, 30, and Steven Seminelli, 28, live in Philadelphia and were among the first to get a license Tuesday. They texted each other during work and decided they had to get a license as soon as they could, Parisi said.

"We didn't want to take the chance of having this be challenged and missing out on our opportunity," he said.

A torrent of celebration 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 and has stifled the ongoing debate of people with differing points of view," party Chairman Rob Gleason said, citing a 1996 ban on gay marriage instituted by state legislators.

The federal judge who issued the ruling, John E. Jones III — a Republican and an appointee of former President George W. Bush — also ordered the recognition of same-sex marriages performed elsewhere as he overturned the ban.

Corbett's office was left to defend the ban last year after Democratic Attorney General Kathleen Kane refused to do so. A spokesman for Corbett's office said it was reviewing the legal issues presented in the opinion.

State marriage bans have been falling around the country since the U.S. Supreme Court struck down part of the federal Defense of Marriage Act last year.

On Monday, Oregon became the 18th state to recognize same-sex marriage 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 two weeks before the U.S. Supreme Court halted weddings there 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 is decided on a ruling this month that overturned that state's ban.

If the Pennsylvania decision stands, it would become the 19th state to legalize gay marriage. It also would create a bloc of 11 states from Maine to Maryland that allow same-sex marriage, in addition to the District of Columbia.