President Trump speaks at a campaign rally Aug. 15 in Manchester, N.H. (Patrick Semansky/AP)

The ballot was pre-filled with Hillary Clinton’s name, but Micheal Baca didn’t want to vote for Hillary Clinton.

The 24-year-old presidential elector in Colorado had a different plan. Weeks earlier, after Donald Trump’s victory in the general election, Baca and a fellow elector began a movement they called “Hamilton Electors,” a long-shot bid to stop Trump from winning the presidency. The idea was to persuade enough members of the electoral college — the body of 538 members who vote for president — to instead cast ballots for Republicans such as former Ohio governor John Kasich, depriving Trump of just enough electoral votes required to become president.

So Baca scribbled Clinton’s name off the ballot. He wrote in Kasich — prompting the state to nullify his vote. And leading Baca to sue.

Now, for apparently the first time, a federal appeals court has upheld the right of “faithless electors” to vote with their conscience — a ruling that throws into question states’ winner-take-all election systems that bind electors to vote for the state’s popular vote winner, attorneys on Baca’s case said. In a 125-page split opinion Tuesday, a three-judge panel on the U.S. Court of Appeals for the 10th Circuit ruled that Colorado’s decision to nullify Baca’s vote and remove him as an elector was unconstitutional.

“The text of the Constitution makes clear that states do not have the constitutional authority to interfere with presidential electors who exercise their constitutional right to vote for the President and Vice President candidates of their choice,” U.S. Circuit Judge Carolyn B. McHugh, an Obama appointee, wrote in the majority opinion, joined by Jerome A. Holmes, a George W. Bush appointee. Mary Beck Briscoe, a Clinton appointee, dissented, arguing the case was moot because no damages could be awarded.

Baca’s attorney, Jason Wesoky, said the ruling essentially makes laws that require electors to vote for the state’s winner unenforceable in Colorado, Kansas, Oklahoma, Wyoming, Utah and New Mexico. He said the legal team, with attorneys from the group Equal Citizens, is seeking review from the Supreme Court before the 2020 election.

“Certainly the entire point is to get the Supreme Court to address this issue, which has never been addressed on its face before,” Wesoky said.

The ruling comes as a growing number of states are rethinking their electoral college systems in response to the 2016 election, after Trump won the presidency despite losing the popular vote by almost 3 million votes. So far, 16 states, including Colorado, have passed laws that would award all of their electoral votes to the winner of the national popular vote — a nationwide initiative that would virtually wipe out the need for an electoral college if enough states join.

It has become a movement embraced largely by Democrats. On Monday, Rep. Alexandria Ocasio-Cortez (D-N.Y.) called the electoral college a “scam,” a “racial injustice breakdown” that gives more weight to white voters and should be abolished. Democratic presidential candidates including Sen. Elizabeth Warren (D-Mass.) and former Texas congressman Beto O’Rourke have supported scrapping the electoral college as well, pushing for a one-person, one-vote system.

But on Wednesday, Colorado Secretary of State Jena Griswold (D) told the Colorado Sun that she feared the 10th Circuit ruling could undermine Colorado’s decision to join the national popular vote movement, saying the ruling “sets an extremely dangerous precedent that would enable a few people to override the majority of Colorado votes.”

“Our nation stands on the principle of one person, one vote,” she told the Sun. “We are reviewing this decision with our attorneys and will vigorously protect Colorado voters.”

Baca launched the Hamilton Electors with a fellow elector from Washington state, Bret Chiafalo, after reading Alexander Hamilton’s Federalist Paper No. 68. In it, Hamilton lays out his vision for the purpose of the electoral college: a buffer to protect against populism.

The founders were skeptical of direct democracy, fearing it was too vulnerable to electing candidates who knew how to please a crowd but lacked the credentials required for office. The electoral college process, Hamilton wrote, “affords a moral certainty that the office of President will never fall to the lot of any man who is not in an eminent degree endowed with the requisite qualifications.”

But over the years, as the 10th Circuit ruling notes, the electoral college overwhelmingly became a rubber stamp intended to reflect the popular vote in each individual state: As of the 2016 election, 29 states and the District of Columbia had laws binding electors to vote for the state’s popular vote winner.

Baca and Chiafalo thought the 2016 election was the time to return to Hamilton’s vision. Baca viewed Trump as “dangerous” and a “threat to our democracy,” he told The Washington Post.

“We’re trying to be that ‘break in case of emergency’ fire hose that’s gotten dusty over the last 200 years,” Chiafalo told the Atlantic in November 2016. “This is an emergency.”

Baca was told it was a long shot — but he didn’t think so. All they needed was 37 out of 306 Republican electors to vote for a candidate other than Trump, and they also sought out Democrats to vote for moderate Republicans. Baca found two takers in Colorado: Polly Baca (no relation) and Robert Nemanich.

But once that pair saw authorities nullify Micheal Baca’s Kasich vote and refuse to allow him to cast a vote for vice president, they felt forced into voting for Clinton. They were also plaintiffs in the lawsuit against Colorado’s State Department with Baca, but the 10th Circuit ruled they did not have standing Tuesday.

In its ruling, the 10th Circuit said that before this case, it was not aware of any state that had nullified an elector’s vote and removed the elector because it didn’t like his or her vote. The court agreed that there has been a long-standing tradition of electors pledging to vote for their party’s nominee — but there is also “an opposing historical practice at play: a history of anomalous votes, all of which have been counted by Congress.”

The court traced the nation’s history of faithless electors all the way back to 1796, when one Samuel Miles voted for Thomas Jefferson instead of John Adams. It infuriated some critics, but ultimately Congress still let it slide. In the 2016 election, the court counted 13 anomalous votes from three states, supporting candidates including Warren and Kasich. Congress has never failed to count these anomalous votes, the court said.

“Although most electors honor their pledges to vote for the winner of the popular election, that policy has not forfeited the power of electors generally to exercise discretion in voting for President and Vice President,” the court wrote. “Rather, as historical practice shows, electors have strayed from their pledges throughout history and Congress has unfailingly counted those anomalous votes.”

Baca told The Post he supports the national popular vote movement — but for the time being, he said, electors should be “freed” from laws that force them to vote for a candidate.

“I want to see everyone in this country have a fair vote,” he said. “I don’t think I should have been allowed to do what I did, but it was allowed under the Constitution — and in my worldview there was an important reason to do it.”