U.S. Sen. Steve Daines, R-Mont., held off a challenge Tuesday from Democratic Gov. Steve Bullock to win re-election to a second term, the AP projects.

The Daines-Bullock battle shattered all records for the price-tag on a single Montana campaign, with more than $150 million spent by the two candidates and 40-some outside groups trying to influence the outcome.

Daines, 58, a former executive with the Bozeman software-development firm co-founded by U.S. Rep. Greg Gianforte, had seemed to be cruising toward an easy re-election this year until Bullock decided in early March to enter the race.

The two-term governor filed as a candidate on the last possible day, March 9, and proceeded to raise $36 million for his campaign in the next six months, outpacing Daines by almost $20 million.

Bullock, 54, had said for months he had no intention of running for the Senate and spent seven months in 2019 running for president, before dropping out in December.

National Democratic figures, including former President Barack Obama and U.S. Senate Minority Leader Chuck Schumer of New York, personally lobbied Bullock to get into the race. But he said later his family was the deciding factor that persuaded him to change his mind.

The contest featured more TV ads than any Senate race in the nation. Bullock and fellow Democrats hammered Daines on health care and his record as a business executive in China, while Daines and Republicans attacked Bullock on everything from gun policy to how he handled the coronavirus to his personal reputation, accusing him of corruption and mistreatment of women.

Bullock, an attorney from Helena, won two terms as governor, in 2012 and 2016, and could not run for a third term because of term limits. He also served one term as attorney general, from 2009-2012.

Bullock pitched himself as a governor who had worked with Republican majorities in the Legislature to pass major initiatives, such as Medicaid expansion and a landmark campaign financial-disclosure law.

Daines broke onto the Montana political scene in 2008, running as lieutenant governor with Republican Roy Brown, losing to Democratic Gov. Brian Schweitzer and his running mate, John Bohlinger.

He briefly ran for U.S. Senate in 2012 before switching to run for an open U.S. House seat, after the Republican incumbent, Denny Rehberg, decided to enter the Senate race against Democratic U.S. Sen. Jon Tester.

Daines won the House seat in 2012 and then ran for Montana’s other U.S. Senate seat in 2014, after Democratic Sen. Max Baucus decided to retire. He defeated Democrat Amanda Curtis to become the first Republican to win that Senate seat since 1913.