Legislation seeking to guarantee the presidency to candidates who earn the popular vote in national elections has narrowly passed Virginia's House of Delegates.

passed on a 51-46 vote on Tuesday, which was the final day for any bills to make it out of the chamber where they originated.

The bill – known as the "National Popular Vote Compact" – first failed in the Privileges and Elections committee at the end of January, but was reconsidered about a week later and advanced with a substitute version.

The bill would join Virginia into a national compact in which states agree to award their electoral votes to the presidential ticket that receives the most popular votes in all 50 states and the District of Columbia.

One Democrat joined Republicans in opposing the bill in Tuesday's floor vote. Three other Democrats abstained from voting.

It now heads to the Senate, where a version of the same bill was withdrawn by its sponsor, Sen. Adam Ebbin. It will need to advance through the Senate before becoming law, but that's expected to be a tougher task.

The bill was introduced by Del. Mark Levine, D-Alexandria.

“The people of the United States should choose the president of the United States, no matter where they live in each individual state,” Levine said when questioned during a committee hearing. “It gives every American equal weight under the law.”

Opponents disagree over his premise.

“One of the things that was in place was to try to ensure that certain large states like California and New York, now, don’t have all the control in making a decision for president,” Sen. Ryan McDougle, R-Hanover, told ABC 8 News.

House Republicans issued a statement on Tuesday's passage of the bill, saying it would let Virginia's votes be decided by states like California and New York:

House Democrats voted today to put big states like New York, California, and Texas in charge of who gets Virginia’s 13 Electoral Votes, passing legislation to ratify the National Popular Vote interstate compact. Should Virginia voters choose a candidate of one party, but the candidate of another party wins the most votes nationally, Virginia’s 13 electors would be required to vote against the candidate chosen by Virginia voters. “Virginia currently assigns its electors to reflect the opinions of voters in the Commonwealth, and this bill might as well have an amendment stating that our electors will be chosen by the State of California, said Del. Israel O’Quinn, (R-Bristol). “Virginians should choose who gets Virginia’s 13 electoral votes -- not a handful of large states. The Electoral College was designed to preserve the voice of smaller states. Virginians should speak for Virginians.”

Levine tried to pass similar legislation the past three consecutive sessions.

“The Electoral College is an outdated institution that creates an undemocratic system for deciding who holds the most important office in the land,” said Del. Ibraheem Samirah, DFairfax, a co-patron of HB 177. “Call me crazy, but I think the person who wins the most votes is the person who should win an election.”

Under the Electoral College, each state is granted a number of electoral votes based on their representation in the U.S. House and Senate. A majority of states award electoral votes to the candidate who receives the most votes in their respective states. The candidate receiving at least 270 electoral votes wins the election.

After Donald Trump won the 2016 election despite losing the popular vote, numerous states signed the NPVC. The NPVC would ensure the candidate who wins the popular vote becomes president when states possessing 270 electoral votes sign onto the pact and give their electoral votes to the candidate through presidential electors.

The compact has been adopted by 15 states and the District of Columbia, which equal 196 electoral votes, according to National Popular Vote, a nonprofit that advocates for the compact. The pact will go into effect once states with at least 74 more electoral votes enact it. At least one chamber in eight additional states with 75 more electoral votes have passed the bill.

“It is really hard to predict how campaigns would respond to this change,” said Alex Keena, assistant professor of political science at Virginia Commonwealth University in Richmond. “We would probably see less campaigning in the smaller swing states and there would be less emphasis on winning states, per se.”

Americans have historically opposed the Electoral College method and prefer naming winners based on the popular vote, according to a 2019 Gallup poll.

“They favor an amendment to the Constitution to make that happen, but are more reluctant to have states make changes to how they award their electoral votes,” Gallup said in a summary of its finding.

Five presidential candidates have won the electoral college without receiving a majority of the popular vote: John Quincy Adams in 1824, Rutherford Hayes in 1876, Benjamin Harris in 1888, George W. Bush in 2000 and Donald Trump in 2016.

Without the compact, a constitutional amendment is required to switch from the Electoral College to the popular vote.

In 1969, Rep. Emanuel Celler introduced House Joint Resolution 681 to abolish the Electoral College and instead require a president-vice president pair of candidates to win at least 40% of the popular vote. The bill passed the House with bipartisan support but failed on the Senate floor, according to congressional records.

“The compact does not require a constitutional amendment, so that route is obviously a lot easier than going through the amendment process,” Keena said.