KUSA — Democrats can celebrate Tuesday night after the state's attorney general office flipped to blue.

While the final returns aren't in yet, it looks like Phil Weiser will defeat Republican George Brauchler.

Weiser’s campaign strategy to position the office of state attorney general as a potential check on President Donald Trump's influence in Colorado appears to have struck a chord in the state.

As The Atlantic notes, a recent campaign ad from the Weiser camp explains how the candidate decided to run for AG as soon as Trump won the 2016 election.

AGs from various states have been cobbling together lawsuits against federal offices, and Brauchler also predicted the race would at least in part be about checking federal executive power instead of state executive power. That's what Brauchler tried to make the race about, according to an article in the Colorado Sun.

Brauchler, the district attorney for the 18th Judicial Branch since 2013, prosecuted the Aurora theater shooter, where a jury sentenced him to life in prison. His name recognition did little to sway voters from Weiser, who barely won his party’s nomination during the primaries.

Weiser faced a primary challenge from State Rep. Joseph Salazar. The results split nearly down the middle, with Weiser winning by just 0.8 percentage points.

After moving past the contentious primary, Weiser enjoyed the endorsements of former President Barack Obama and former Vice President Joe Biden. He also clerked for current Supreme Court Justice Ruth Bader Ginsburg. His pro-choice stance also likely helped him with Colorado's more liberal voters.

The race for AG did not come cheap for either party. Weiser raised and spent well over $2 million dollars. While Brauchler didn't raise or spend nearly as much, the Republican Attorney General Association pumped $3 million in the race with just weeks to go before the election, according to the Colorado Sun. Republicans were hopeful that Brauchler's charm would draw votes over Weiser's law clerk persona, but voters were not swayed.