As expected, North Carolinians voted in large numbers on Tuesday for an amendment that would ban same-sex marriages, partnerships and civil unions, becoming the 30th state in the country and the last in the South to include a prohibition on gay marriage in the state constitution.

About half a million people voted early, a record for a primary in the state, and turnout on Tuesday was unusually high as well. The amendment, which passed by a margin of more than 20 percentage points, was on the ballot along with other party primary races, some of which were closely contested.

The vote came after weeks of heated debate in church pews and over the airwaves. More than $3 million was spent on the rival campaigns. Ministers formed coalitions pushing for and against the measure, and cities passed resolutions condemning it. Former President Bill Clinton and the Rev. Billy Graham weighed in on opposite sides, and law professors skirmished over the consequences.

North Carolina, a religious but also relatively moderate state on social issues, already has a law banning same-sex marriage. But Republican lawmakers pushed an amendment out of concern that the law was in danger of being struck down by judges.