A federal appeals court ruled late Tuesday that presidential electors who cast the actual ballots for president and vice president are free to vote as they wish and cannot be required to follow the results of the popular vote in their states.

The decision could give a single elector the power to decide the outcome of a presidential election — if the popular vote results in an apparent Electoral College tie.

"This issue could be a ticking time bomb in our divided politics. It's not hard to imagine how a single faithless elector, voting differently than his or her state did, could swing a close presidential election," said Mark Murray, NBC News senior political editor.

It hasn't been much of an issue in American political history because when an elector refuses to follow the results of a state's popular vote, the state simply throws the ballot away. But Tuesday's ruling says states cannot do that.

The decision, from a three-judge panel of the 10th U.S. Circuit Court of Appeals in Denver, is a victory for Micheal Baca, a Colorado Democratic elector in 2016. Under state law, he was required to cast his ballot for Hillary Clinton, who won the state's popular vote. Instead, he crossed out her name and wrote in John Kasich, a Republican and then the governor of Ohio.

Download the NBC News app for breaking news and politics

The secretary of state removed Baca as an elector, discarded his vote and brought in another elector who voted for Clinton. In a 2-1 decision, the appeals court said the nullification of Baca's vote was unconstitutional.

When voters go to the polls in presidential races, they actually cast their votes for a slate of electors chosen by the political parties of the nominees. States are free to choose their electors however they want, Tuesday's ruling said, and can even require electors to pledge their loyalty to their political parties.

But once the electors are chosen and report in December to cast their votes as members of the Electoral College, they are fulfilling a federal function, and a state's authority has ended. "The states' power to appoint electors does not include the power to remove them or nullify their votes," the court said.

Because the Constitution contains no requirement for electors to follow the wishes of a political party, "the electors, once appointed, are free to vote as they choose," assuming that they cast their vote for a legally qualified candidate.

A total of 30 states have laws that bind electors, requiring them to cast their votes for whichever candidate won that state's popular vote. But the laws are weak, providing only nominal penalties for what are known as "faithless electors" who fail to conform to the popular vote.

The Supreme Court ruled in 1952 that states do not violate the Constitution when they require electors to pledge that they will abide by the popular vote. But the justices have never said whether it is constitutional to enforce those pledges.

Legal scholars said Tuesday's ruling was the first from a federal appeals court on the issue of faithless electors. It applies immediately to the six states of the 10th Circuit: Colorado, Utah, Wyoming, Kansas, Oklahoma and New Mexico.

“This court decision takes power from Colorado voters and sets a dangerous precedent," said Jena Griswold, Colorado's secretary of state. "Our nation stands on the principle of one person, one vote. We are reviewing this decision with our attorneys, and will vigorously protect Colorado voters.”

The federal court ruling conflicts with a decision from Washington state's Supreme Court in May, which said electors must follow the results of the popular vote. "The power of electors to vote comes from the state, and the elector has no personal right to that role,” the court said.

Lawyers from the nonprofit Equal Citizens, which represented the Washington state electors and Baca in Colorado, said they will appeal the Washington ruling to the Supreme Court.

“We know Electoral College contests are going to be closer in the future than they have been in the past. And as they get closer and closer, even a small number of electors could change the results of an election," said Lawrence Lessig, a Harvard law professor who founded Equal Citizens and is part of its legal team. "Whether you think that’s a good system or not, we believe it is critical to resolve it before it would decide an election.”

If the Supreme Court chooses to take up the dispute, it would have time to rule on the issue before the Electoral College meets in December 2020 to cast the formal vote for president.