Maine has become the first state in the nation to change the way voters elect candidates to Congress, the Legislature and the governor’s office.

With 93 percent of ballots counted, Question 5, which could make Maine the first state to pick statewide candidates with a ranking system, was leading with 52 percent to 48 percent support, a margin of nearly 29,000 votes.

In ranked-choice voting, voters rank candidates in order of preference. If no candidate has more than 50 percent of the top votes cast after the first tally, the candidate with the fewest votes is eliminated. Voters who chose the eliminated candidate have their ballots added to the totals of their second-ranked candidate and the ballots are retabulated. The process continues until one candidate has a majority of votes and is declared the winner.

Critics of the change, including Gov. Paul LePage, said it violates the Maine Constitution, which calls for election winners to be chosen by a plurality of the vote.

Supporters said the measure gives voters more power and the ability to vote for the candidate they like best instead of casting “a lesser of two evils” vote, as many voters said they felt they were doing in this year’s presidential race.

Roger Poulin, 52, of Lewiston said he voted against the measure Tuesday largely because it was too complicated. Poulin said he also believes that counting ballots for ranked candidates would take too long and cost too much.

“I mean you count them, you recount them and count them again until you end up with a majority winner?” Poulin asked. “It’s too confusing, too complicated. You vote, you vote.”

But Kale Dodge, 18, of Auburn, who was voting for the first time Tuesday, said he likes the idea of ranking candidates. Dodge said he thinks the change would eliminate candidates who are too polarizing for the majority of voters. “If we would have had ranked-choice this year, Trump would not have been the Republican nominee, let’s just put it that way,” Dodge said.

The measure, which was promoted by a broad coalition of Democrats, Republicans and independents in Maine, was supported by the Committee for Ranked Choice Voting, a political action committee that collected nearly $600,000 in donations to support the measure. Much of that money came from small donors around Maine. The committee also benefited from larger infusions of cash from out of state, including $78,000 from Fair Vote, a Washington state nonprofit that advocates for ranked-choice voting across the country.

There was no organized opposition against the measure. LePage and Republican Rep. Heather Sirocki of Scarborough were the most high-profile opponents.

Maine would be the first state to adopt ranked-choice voting, although a number of cities have adopted it, including Portland, which uses it to select its mayor.

Supporters in Maine held ranked-choice voting demonstrations in the form of beer tastings at brew pubs as a way of showing people how the system works.

As polls were closing Tuesday, Kyle Bailey, campaign manager of the Committee for Ranked Choice Voting, said those efforts have been largely successful, with voters coming away with a better understanding of the process.

“When we look at governor’s race after governor’s race where the winning candidate has failed to get a majority of voters, Mainers just know it and feel it that the system is broken,” Bailey said.

He noted that no Maine governor has been elected to a first term by a majority since 1966, when Mainers voted for Democrat Ken Curtis.

Portland voter, Jill B. Guiliani, 48, said she too supported the change.

“I feel that in order to get the lesser of evils you should get a second choice,” Guiliani said.

This report will be updated.