The liberal-aligned Sunflower State PAC spent more than $5 million opposing Roger Marshall’s candidacy, likely viewing ultra-conservative Trump ally Kris Kobach as an easier target for Democrat Barbara Bollier to take down in the general election.

But the investment didn’t pay off. The race was called in favor of Marshall shortly after the polls closed. He had 40 percent of the vote, compared to only 26 percent for Kobach. As expected, Bollier sailed through her primary with 85 percent of the vote.

Marshall’s victory only adds to Kobach’s string of losses in the reliably red state. In fact, he was the only Republican in Kansas to lose a statewide election in 2018 when he ran for governor against Democrat Laura Kelly. He also lost his congressional bid in 2004 to a liberal candidate, despite the fact that the state overwhelmingly voted for George W. Bush’s second term.

Democrats were hoping for a similar scenario this fall. But Republicans say the outside attempt to persuade conservatives to vote for Kobach only backfired.

“Republicans who appreciate how important this seat is and what a disaster Kris Kobach is have spent a year trying to convince our fellow Kansas Republicans that Kris Kobach was the Chuck Schumer candidate. And then Chuck Schumer came in with $5 million and proved it for us. They would have been better off keeping that money in their pocket,” David Kensinger, a longtime Kansas GOP operative, told Newsweek.

While some in the Republican Party have suggested the Sunflower State PAC is linked to the national Democratic establishment, it’s unclear who exactly is behind the group. But they’ve used the same media buyer, Old Town Media LLC, as the pro-Joe Biden Democratic super PAC Unite the Country.

The Sunflower State PAC was officially formed in mid-July, just weeks before the August 4 primary. The group has not yet had to disclose its donors or other information to the Federal Election Commission. Newsweek reached out to both the Kobach and Marshall campaigns for comment on the group but did not receive a response prior to publication.

In one ad from the group, the narrator said Kobach’s “too conservative” and “won’t compromise” on building President Trump’s border wall or taking a tough stance on China. As for Marshall, the ad described him as a “phony” who has “been soft on Trump and weak on immigration.” While the clip criticizes both candidates, tying Kobach to Trump is a boost in a state where the president won by 21 points in 2016.

Marshall criticized the group in an op-ed for the Topeka Capital-Journal last month, writing that the “Sunflower State PAC thinks they can dupe conservatives into voting for the candidate they want to face. It’s a bunch of smug Washington elites who think they can sneak one past you.”

Nathaniel Birkhead, associate professor of political science at Kansas State University, told Newsweek that “it was a long shot to get Kobach over the line because ads only work if people are persuadable.”

He added, “From the Democrats perspective, they thought it was worth taking a gamble…It seems like in this new era, money is relatively cheap. They can afford to push on a few long shots and if one or two turns up then it’s worth it.”

Meddling in another party’s primary is a common trend, but it has varying levels of success. It worked in 2012 when Democrats stepped in to help Republican Todd Akin win his party’s Senate primary. He lost to former Senator Claire McCaskill, who later wrote in her memoir about how she helped her Akin get nominated so she could beat him. Earlier this year, Republicans spent $3 million in the North Carolina Democratic primary backing Cal Cunningham’s opponent Erica Smith. Cunningham still won and is now outpolling Republican incumbent Thom Tillis.

Kobach’s weakness was a rare point of convergence for Democrats and Republicans as the two parties battle for majority control of the Senate this November. Democrats need to flip four or five seats in order to reclaim control and Kansas’s emergence as a potential battleground for majority control of the Senate attracted millions in donations and outside spending.

GOP leaders were so concerned about the idea of Kobach being the nominee that Majority Leader Mitch McConnell tried to recruit Secretary of State Mike Pompeo to run for the Kansas seat in the final weeks of the primary. Pompeo declined.

The Senate Leadership Fund, a super PAC linked to McConnell, spent roughly $1. 9 million in an effort to aid Marshall’s campaign. The Plains PAC, another conservative group, spent $3.3 supporting Marshall in the primary.

Marshall will now have to face Bollier, a physician, state senator and former Republican, in the general election. She’s well-resourced and well- funded. The latest campaign finance filings showed that she had more than $4 million in the bank, compared to Marshall’s $1 million.

The latest poll of the race showed Marshall and Bollier neck and neck. The June Civiqs survey of nearly 700 registered voters found Marshall with 42 percent support and Bollier with 41 percent.

In a virtual victory speech on Tuesday, Bollier vowed to be an “independent voice willing to stand up for what’s right for Kansas.” Her address was made before the results of the Republican primary were announced.

“This much is clear after watching that messy primary. No matter who wins, all have demonstrated they are content to simply be a ‘Yes Man’ for his political party. That’s the last thing we need right now,” she said.