PORTLAND, Maine — The Maine Supreme Judicial Court on Thursday

told a national organization opposed to gay marriage that it must turn over the names of donors from the 2009 people’s veto campaign that repealed a law allowing same-sex couples to wed.

The justices unanimously upheld a lower court’s ruling that the National Organization for Marriage and its allies cannot shield the names of donors from the state’s election oversight commission.

In affirming an earlier an decision issued last June in Kennebec County by Superior Court Justice Michaela Murphy, justices on the state supreme court rejected NOM’s arguments that subpoenas issued by the Maine Commission on Governmental Ethics and Elections Practices violate donors’ First Amendment rights and expose them to “threats, harassment and reprisal.”

The court heard arguments in the case on April 11.

“Our review of the extensive record, the Superior Court’s well-reasoned opinion, and the detailed analysis of related issues by our federal court colleagues leads us to conclude that, on the facts of this case, the Commission did not err,” Chief Justice Leigh I. Saufley for the court wrote in the five-page opinion.

Maine Attorney General Janet Mills on Thursday called the decision “one more victory in a long saga — three-and-a-half years of litigation in which we contend the public has a right to know who wrote the checks in the amount of nearly $2 million that went through NOM into the Stand for Marriage Maine.”

Stand for Marriage Maine and Brian Brown, head of NOM, also are listed as appellants in the decision issued Thursday.

Efforts to reach NOM on Thursday were unsuccessful.

Based in Virginia, NOM is a major, national opponent of same-sex marriage legislation. It raised about $1.9 million, the vast majority of the $2.5 million spent in the 2009 campaign that repealed gay marriage in Maine. The Roman Catholic Diocese of Portland contributed more than $500,000 to that campaign, according to previously published reports.

NOM did not register as a political action committee, as the state’s campaign finance laws required, according to the ethics commission. If NOM solicited funds from donors specifically for the Maine repeal effort, it would have to turn over to the commission the names, address and other information about those contributors.

The commission asked for the names of NOM’s campaign donors “to evaluate the oral communications NOM made in soliciting donations during the 2009 election season, a critical issue in determining NOM’s compliance with Maine’s campaign laws,” the ruling states.

Federal courts also have ruled against NOM’s legal arguments against releasing the names of campaign donors. The Maine Supreme Judicial Court cited those rulings in Thursday’s decision.

In 2010, U.S. District Judge D. Brock Hornby upheld the state’s disclosure laws as they relate to ballot committees. Early last year, the 1st U.S. Circuit Court of Appeals agreed with Hornby’s ruling. In August 2012, the U.S. Supreme Court declined to take up NOM’s appeal.

Jonathan Wayne, executive director of the commission, said that he expected a final report on the investigation to be completed in two to three months. He also said that due to federal lawsuit, the commission had received many documents from NOM, but they were sealed by court order.

In a November 2012 statewide referendum, Maine voters legalized same-sex marriage. NOM complied with the state’s campaign finance laws in the 2012 election, according to previously published reports.