SALT LAKE CITY - The last of the Utah counties that were holding out on issuing marriage licenses to same-sex couples reversed course Thursday and decided to hand out licenses to all eligible applicants.

Officials for the four holdouts - Box Elder, Utah, Piute, and San Juan Counties - told the Associated Press they made the decision to offer licenses to same-sex couples.

County clerks say they had little choice after an appeals court Tuesday declined to intervene and halt gay marriage. U.S. District Judge Robert Shelby on Friday ruled that Utah's ban on same-sex marriage was unconstitutional, sending gay couples rushing to clerk offices for licenses.

The state is preparing an appeal.

The Utah Attorney General's Office had said counties could be held in contempt of federal court if they refused to comply.

The holdouts said they decided to play it safe and obey Shelby's ruling despite reservations and questions about their legal liability. Utah law makes it a misdemeanor for county clerks to sanction a same-sex marriage.

San Juan County Clerk Norman Johnson said that "what finalized it for me" was Gov. Gary Herbert's order to state agencies to comply with Shelby's decision and change procedures for the delivery of state services. To that end, the Utah Department of Workforce Services is recognizing gay couples for food-stamp and welfare benefits.

Johnson said he felt like he was being dragged into granting marriage licenses against the wishes of voters who have kept him in office for 14 years.