Gay marriage advocates cheered victories in voter initiatives in Maryland and Maine Tuesday night, and seemed poised to win in two other states. The votes were first setbacks at the ballot box for opponents of same-sex marriage after more than 30 victories.

With 93 percent of the vote counted in Maryland, Ballot Question 6, which legalizes gay marriage in the state, was leading by 52 percent to 48 percent, and supporters were already claiming victory in the heated and expensive battle.

“Today the marriage equality map expands to Maryland, giving thousands more loving couples the opportunity to make lifelong commitments through marriage,” said Chad Griffin, president of the Human Rights Campaign, which poured almost $3 million into the Maryland ballot issue.

Maryland Gov. Martin O’Malley, who pushed for gay marriage, said to Maryland’s children, “please know that you and your families matter to the people of our state. Whether your parents happen to be gay or straight, Democratic, Republican or independent, your families are equal before the eyes of the law.”

In Maine, Question 1, which also approves gay marriage, was ahead 52 percent to 48 percent, with 60 percent of the precincts counted.

“Maine voters chose freedom over fear,” said Shenna Bellows, executive director of the American Civil Liberties Union of Maine.