LOUISVILLE, Ky. — Benjamin Moore and Tadd Roberts wore matching tuxedos to the county clerk’s office in Louisville to get married Friday, and the mayor greeted them with a bottle of champagne.

They were among a rush of gay couples across the South and Midwest who celebrated the Supreme Court’s ruling legalizing same-sex marriage with spontaneous weddings. They were young and old, they wore gowns and suits or T-shirts and jeans, they kissed and waved flags that read “love wins.”

“It’s just been incredible and historic and amazing to live this moment,” Moore said, after the mayor took commemorative photos of him and Roberts getting their license.

But the reaction wasn’t as welcoming in some of the 14 states that had been the last holdouts against same-sex marriages, creating confusion as some officials embraced the ruling and others resisted it.

In rural Alabama, the heart of the battle against gay marriage, Pike County Probate Judge Wes Allen said he would stop issuing all marriage licenses to avoid having to give them to gay couples. Allen said Alabama law gives judges the option of granting licenses, and “I have chosen not to perform that function.”

Governors in Louisiana, Mississippi and Texas also railed against the ruling. And clerks in some of the affected states refused to issue licenses, citing a three-week grace period allowed by the Supreme Court or forms now out of date that specify “bride” and “groom.”

But by Friday afternoon, couples had received licenses in all but one of the 14 states, according to the Human Rights Campaign. In Louisiana, where Republican Gov. Bobby Jindal is running for the White House as a conservative Christian, same-sex couples were turned away.

In Texas, many counties held off on issuing same-sex marriage licenses until receiving guidance from Republican Attorney General Ken Paxton, who scolded the Supreme Court but left counties in limbo for hours. The delay dragged on for hours in Houston, until the clerk relented and agreed not to wait for updated forms from the state.

Other clerks scrambled to issue licenses as gay couples rushed to their offices.

In Arkansas, Pulaski County Clerk Larry Crane held a hand to his heart after the Supreme Court’s ruling.

“It is a special day,” he said, choking up. “I’m honored to be a part of it.”

Minister Danielle Goeckel stood on the steps of the Fulton County courthouse in Atlanta on Friday morning holding a sign reading: “Yes I will gladly marry you!”

The fee for her services? Two hugs.

Jessica Dent and Carolee Taylor got married a few blocks from the courthouse in Montgomery, Alabama.

“Never thought it would happen in our lifetime,” said Taylor.

The Human Rights Campaign sent letters to the governors of the 14 affected states warning that delaying issuing marriage licenses would be unlawful.

Some opponents made a religious freedom argument.

“No Texan is required by the Supreme Court’s decision to act contrary to his or her religious beliefs regarding marriage,” Abbot said.

Abbott issued a memo saying the government should not pressure people to violate their “sincerely held religious beliefs.” He later clarified that he does not condone discrimination or authorize state agencies to deny benefits to same-sex couples.

Jindal issued a statement vowing to never stop fighting for “religious liberty.”

“Marriage between a man and a woman was established by God, and no earthly court can alter that,” he wrote.

The Supreme Court allows for a 25-day delay while it considers a rehearing. The Louisiana Clerks Association advised clerks to wait until then before issuing licenses.

In other states, governors, even those who disagree with the ruling, made decisive statements, calling gay marriage the law of the land and instructing their clerks to issue licenses right away.