The law in question was passed by the Legislature in May but never took effect because of a petition drive by conservatives.
With more than 84 percent of precincts reporting Tuesday, the side seeking to repeal the law had 53 percent of the vote. Their campaign organizer, Frank Schubert, claimed victory and declared that Maine voters had helped preserve the institution of marriage.
Gay-marriage supporters refused to concede, holding out hope that that the tide might turn as the final returns came in. They had been hoping Maine would become the first state to approve same-sex marriage at the ballot box.