Republican Karen Handel fended off a massive influx of Democratic cash from across the country on Tuesday to win the most expensive congressional race in history.

The special election in Georgia was called for Handel who had 52.4 percent of the vote late Tuesday compared with 47.6 for the rookie Democrat Jon Ossoff.

“I wanted to come down and really give an extraordinarily heartfelt thank you to every single one of you in this room,” Handel told supporters as the results were coming in. “Campaigns are won by the foot soldiers and people like you.”

The hotly contested to fill the empty seat left by Health Secretary Tom Price was considered as partly a referendum on President Trump in a deeply Republican district.

Spending by the candidates and outside groups exceeded $50 million, with Osoff taking most of his cash from Democrats from outside the state who wanted to send a message to The White House.

The president even weighed in on the race, although Handel distanced herself from him on the trail.

“KAREN HANDEL FOR Congress,” Trump tweeted early Tuesday. “She will fight for lower taxes, great health care strong security – a hard worker who will never give up! VOTE TODAY!”

In the end, Handel, the former Georgia secretary of state, was able to hold the seat for the GOP majority in Congress.

With AP