Voters in Maine and Maryland approved same-sex marriage on an election night that jubilant gay rights advocates called a historic turning point, the first time that marriage for gay men and lesbians has been approved at the ballot box.

While six states and the District of Columbia have legalized same-sex marriage through court decisions or legislative decisions, voters had rejected it more than 30 times in a row.

Results for the other two states voting on same-sex marriage, Minnesota and Washington, were still coming in late Tuesday, but rights groups said that the victories in two states and possibly more were an important sign that public opinion was shifting in their direction.

“We have made history for marriage equality by winning our first victory at the ballot box,” said Chad Griffin, the president of the Human Rights Campaign, which raised millions of dollars for the races in the four states.