Ozier Muhammad/The New York Times

Diana Khan, 46, never thought she would be trading in her Muslim headscarf for a wife.

Ms. Khan, a Puerto Rican grandmother from Brooklyn, married her longtime girlfriend, Mersedita Sanchez, 45, on Sunday. The moment had particular resonance, Ms. Khan said, as she had converted to Islam more than 20 years ago after marrying a Pakistani man, and had been wearing a hijab and praying several times a day.

No longer. Dressed in a floral summer dress, her body adorned with 21 floral tattoos and multiple piercings, Ms. Khan said her journey to a small chapel in Queens to wed Ms. Sanchez had been a long one. (Never mind having woken up at 4 a.m. to make the pilgrimage to get to the front of the marriage line.)

The two met 18 years ago during a game of dominoes at Ms. Khan’s sister’s house, Ms. Khan recalled. For Ms. Sanchez, it was love at first sight. “I fell in love with her smile,” said Ms. Sanchez, decked out for her nuptials in a black T-shirt with a tuxedo image ironed on. “I was like ‘wow.’”

“I was, like, straight at the time,” Ms. Khan said, smiling widely. “I had been a Muslim. I had had a husband. But I always had an inkling I was gay, so meeting Mersedita was a liberation.”

It helped, Ms. Khan said, that both of their families had been supportive.

The giggling and euphoric couple, both wearing blue “just married” sashes, said they had been eager to wed on the first day the same-sex marriage law went into effect, as it was a chance to make history.

“Puerto Rico is too conservative and Catholic; we can’t get married there,” Ms. Sanchez said. “To get married in our own city, in New York, was important. We had waited long enough.”

Ms. Khan said the ceremony at the clerk’s office in Queens lasted three minutes. The air-conditioner was blasting. There was no rousing music. The judge was avuncular, enthusiastic and to-the-point. They were accompanied by Ms. Khan’s granddaughter Tiana. The two planned to celebrate with a brunch of steak and eggs — then an eventual honeymoon in Montego Bay.

“I am so happy for them; it’s a blessing,” said Glee Williams, Ms. Khan’s sister-in-law. “Everyone deserves to be happy.”