The Democratic-led Virginia House of Delegates has passed legislation that seeks to award the state's electoral votes to the presidential candidate that wins the national popular vote in an election.

The measure, also known as House Bill 177, passed the legislative chamber in a 51-46 vote on Tuesday after clearing the body's Privileges and Elections Committee in a vote last week.

If the legislation is passed by the Senate, where Democrats also hold control, and signed into law by the governor, Virginia would subsequently be entered into the National Popular Vote Interstate Compact.

"Under the compact, Virginia agrees to award its electoral votes to the presidential ticket that receives the most popular votes in all 50 states and the District of Columbia," a bill summary states. "The compact goes into effect when states cumulatively possessing a majority of the electoral votes have joined the compact."

"A state may withdraw from the compact; however, a withdrawal occurring within six months of the end of a President's term shall not become effective until a President or Vice President has qualified to serve the next term," the summary continues.

So far, only 15 states and Washington, D.C., have entered the compact, according to National Popular Vote, a nonprofit group tracking the status of states on the issue. A group of states possessing 74 electoral votes would need to join the agreement in order for the compact to take effect.

The legislation's passage on Tuesday comes as number of states have moved to pass similar measures seeking to enter into the compact in recent years since President Trump was elected in 2016.

Though Trump didn't win the popular vote in the 2016 presidential election, he was able to win the contest after gaining more electoral votes than former Secretary of State Hillary Clinton, despite her earning nearly 3 million more votes than him at the ballot box.