Three of Iowa's Supreme Court justices were voted out of office last night, chalking up a victory for the national anti-gay groups that spent hundreds of thousands of dollars on the race.

With nearly all precincts reporting, the three justices — David Baker, Michael Streit and Chief Justice Marsha Ternus — were voted out by an average margin of 55% to 45%.

It's the first time an Iowa Supreme Court justice has been ousted since Iowa instituted its system of appointment and retention in 1962.

Last year, the Iowa Supreme Court's seven justices voted unanimously to legalize same-sex marriage in the state, making them a target of groups like the National Organization for Marriage, the American Family Association and the Family Research Council, who declared the ruling a case of gross judicial activism and usurpation of power.

The groups spent more than $700,000 to convince voters to kick the judges out, funding a statewide "Judge Bus" tour, radio ads, TV ads, text messages and polling. Even Citizens United chipped in $18,000 at almost the last minute.

The president of the Human Rights Campaign, which drew attention to the anti-gay groups' efforts, warned today that the victory was intended to intimidate judges nationwide.

"By their own admission, NOM's Iowa strategy was about sending a warning shot to judges nationwide," HRC president Joe Solmonese said in a statement. "NOM and its secret donors will continue to target judges around the country if they rule in favor of marriage equality and will foster an anti-gay, hostile environment in the process."

In Iowa, judges are not elected. But at the end of each term, they go up for retention, meaning Iowans can vote yes or no one whether to keep them around. If they kick the justices out, as they did last night, the governor appoints new ones. The governor is currently Chet Culver, a Democrat, but last night Republican Terry Branstad won and will become governor in January.

During the campaign, Branstad did not take a position on judicial retention. When he was governor 12 years ago, however, he signed the Iowa Defense of Marriage Act, and has supported amending the Iowa constitution to prohibit same-sex marriage. He has said same-sex marriage lead to the crumbling of ancient civilizations, but has also supported the idea of civil unions.

Republished with permission from Authored by Rachel Slajda. Photo via TPM provides breaking news, investigating reporting and smart analysis of politics.