Scores of gay and lesbian couples tied the knot on Friday following a federal ruling declaring the state's ban on same-sex unions invalid.

Long lines quickly formed at county clerk offices as gay couples rushed to secure marriage licenses before an expected stay on the ruling is issued.

(Related: Judge strikes down Utah's gay marriage ban; Clerk starts issuing licenses.)

According to Q Salt Lake, the first couple to marry in Salt Lake County was Michael Adam Ferguson and J. Seth Anderson.

“Deputy Salt Lake County Clerk Wany Morrison was in tears as she handed the couple their license to marry,” the outlet reported.

“Me and my new husband!!” Anderson messaged on Twitter along with a photo of the pair holding their marriage license. “My polygamous Mormon great grandparents would be so proud!”

Some gay couples were turned away. Clerks in at least four counties – Utah, Weaver, Washington and Davis – refused to issue licenses to gay couples seeking them, the AP reported.

In Salt Lake City, state Senator Jim Dabakis married longtime partner Stephen Justesen. The wedding was officiated by Mayor Ralph Becker, a strong supporter of gay rights. Dabakis in 2011 was elected chairman of the Utah Democratic Party, making history as the first openly gay man to lead a major party in the state.

State officials late Friday filed a notice of appeal in the ruling and a request for an emergency stay.