ALBUQUERQUE — Voters here on Tuesday defeated a ballot question that sought to ban abortions after 20 weeks of pregnancy, delivering a critical setback to an anti-abortion movement that had sought to use this progressive city to recalibrate the national debate around women’s reproductive rights.

The referendum, the first of its kind in the country for a municipality, was marked by record turnout and aggressive tactics by volunteers on both sides, who sought to capitalize on the controversy and passion surrounding the issue to drive voters to the polls. For political strategists, it also offered a chance to test the way their message on abortion resonated among Hispanics, a key constituency that accounts for nearly half of the residents in Albuquerque and New Mexico, and is one of the fastest-growing populations in the country.

“This was a clear counterpunch to the Republicans and right-wingers who came from out of state to push their agenda on us,” Sam Bregman, chairman of the New Mexico Democratic Party, which campaigned hard against the ban, said in an interview.

According to the city clerk’s office, about 87,000 votes were cast in the election, or 25 percent of Albuquerque’s registered voters. The final tally was 55 percent of votes against and 45 percent of votes for the abortion ban.