Nine Colorado presidential electors on Monday cast their votes for Hillary Clinton, winner of the general election in the state, but only after one broke ranks and was replaced.

In what usually is a ceremonial affair that rubber stamps the popular vote in all 50 states, Monday’s meeting of Colorado’s Electoral College delegates was derailed moments after it began. Attorneys phoned in a judge in a last-ditch effort to unbind electors from the popular vote and allow them to vote as they pleased.

By the time votes finally were cast at about 12:45 p.m. — 45 minutes after the ceremony was scheduled to begin — it was clear that the broader national effort to block Donald Trump from being elected was destined to fail.

But Micheal Baca, a Democratic Colorado elector who was among the leaders of that effort, cast a vote for Republican Ohio Gov. John Kasich, anyway — just moments after he took an oath to vote for Clinton.

The scene at the Colorado capitol dissolved into a chorus of boos and shouts as the tally was announced and officials moved to replace Baca, as allowed under procedures outlined in a court hearing last week.

“You did not do your job,” one woman shouted at the electors who voted for Clinton, as others began to chant Baca’s name.

The crowd’s ire soon focused on Secretary of State Wayne Williams, as he tried to restore order and remove Baca for his unlawful vote.

“Threatening elections is also against the law, Secretary Williams,” Baca shouted at him.

Moments after the vote, Williams reaffirmed that the state law binding electors is necessary to enshrine the will of the Colorado voters.

“Colorado law since 1959 has provided that you have a very specific requirement as an elector in Colorado,” he said. “You must vote as the Colorado citizens vote.”

In order to succeed, the “Hamilton Electors” group needed to convince 37 Republican electors nationwide to vote against Trump to deny him the 270 electoral votes needed to clinch the presidency. In recent weeks, Colorado became an unlikely test case for the movement when two Democratic electors, Polly Baca and Robert Nemanich, filed legal challenges seeking to unbind their votes.

The legal battle continued Monday morning when their attorneys filed an emergency motion asking that the Denver District Court require Williams to administer an oath that has been used in years past.

That oath, which mirrors language in the state constitution, simply requires the electors to “faithfully perform the duties of the office.” Williams had planned to have electors swear also to vote for the winner of popular vote in Colorado, Clinton.

A judge granted the electors’ motion, ruling that to establish a new oath, the secretary of state would have to adopt a new election rule. Shortly after, Williams issued an emergency rule to create a new oath requiring the electors to vote for the winner of the popular vote.

The dispute spilled into the statehouse as the voting ceremony began, with attorneys for both sides arguing over the appropriateness of the new ruling, while the public waited in the foyer.

In a conference call with attorneys, Denver District Judge Elizabeth Starrs ruled the issue was resolved, and the officials proceeded with the voting after a recess.

“The oath is consistent and complies with my court order less than an hour ago,” Starrs said. She said the electors could file a legal challenge to the new rule, but it would not be heard until January.

As the electors contested the oath, a crowd of hundreds in the foyer and grand staircase spontaneously broke into song. The crowd sang “This Land is Your Land” and protest anthems, such as “We Shall Overcome.”

After the votes were tallied and Micheal Baca was replaced with Celeste Landry, the crowd pleaded with her to “vote her conscience.”

“The whole world is watching,” the crowd began to chant.

Landry, a 53-year-old from Boulder, voted for Clinton. The other Clinton electors had split opinions of what Baca did.

Robert Nemanich, who was among the electors who sued to be unbound, said his vote for Clinton “was coerced and compelled to vote by the oppression of the state.”

Elector Jerad Sutton said he would have considered joining the movement, but it was futile.

“If there were 269 other people willing to do that, I’d do it too,” he said.

Amy Drayer, an elector from Greenwood Village, said she was disappointed that the faithless elector movement upstaged what should have been a historic moment for Colorado Democrats.

“The fact that Colorado is one of the states that by a popular majority voted to send the first woman president to office, I’m disappointed that that’s not what this is about,” Drayer said. “I was really excited to do my job today.”

Steve Barlock, a Republican elector who watched the ceremony, had a harsher take on how his Democratic counterparts handled their duty.

“I find it pretty disgusting, actually,” he said.

The electors filed their motion Monday after the 10th U.S. Circuit Court of Appeals late Friday evening rejected a separate emergency motion asking the court to unbind their votes.

That ruling, even as it was a defeat for the electors, had offered a glimmer of hope for the broader faithless elector movement. In a footnote, the federal court suggested that the secretary of state’s plans to remove an elector if they vote the wrong way may be unconstitutional.

“We deem such an attempt by the State unlikely in light of the text of the Twelfth Amendment,” the court wrote.

But even as it suggested that the secretary of state’s actions might be illegal, the 10th Circuit rejected the electors’ broader argument that Alexander Hamilton’s essay, Federalist 68, provided insight into the intended role of the Electoral College.

Williams, who has suggested that faithless electors could face a criminal charge, said he would refer the matter to the attorney general’s office, saying “I believe when you take an oath, you should follow that oath.”

Outside Colorado’s state capitol, more than 100 protesters had gathered by mid-morning to protest Trump’s election.

“I feel like if there’s ever a time that the Electoral College should do its job, it’s now,” said Julie Lyke, 52, who came from Fort Collins to attend the protest. “If we don’t use it now, why use it at all?”