President Trump criticized Republican Ed Gillespie within moments of his projected loss in Tuesday's Virginia gubernatorial race, suggesting he fell short because he did not “embrace” Trump's agenda.

“Ed Gillespie worked hard but did not embrace me or what I stand for. Don’t forget, Republicans won 4 out of 4 House seats, and with the economy doing record numbers, we will continue to win, even bigger than before!” Trump tweeted from Seoul, South Korea on Tuesday night, minutes after the gubernatorial race was called for Democratic Lt. Gov. Ralph Northam.

The president repeatedly had urged voters to support Gillespie leading up to Tuesday's vote. The Republican nominee, though, kept a certain distance from the president throughout the campaign, even as he adopted some of the president's tough immigration policies.

But while Gillespie tried to strike a balance in the swing state -- the only southern state Trump lost in last year's presidential election -- Democrats worked hard to tie Gillespie to the president at every turn.

One controversial ad showed minority children seemingly being chased by a driver in a pickup truck, decked out with a Confederate flag and a “Gillespie for governor” bumper sticker. The ad concluded with a scene of a Charlottesville-like rally, with a narrator asking: “Is this what Donald Trump and Ed Gillespie mean by the ‘American Dream?’”

The ad was removed after extensive backlash.

Other mailers from Northam’s camp boasted that he is “standing up to Trump and Gillespie’s politics of fear and hate.”

Northam campaigned with Democratic power players like former President Barack Obama and former Vice President Joe Biden and even had a fundraiser headlined by Hillary Clinton.

Meanwhile, Gillespie garnered Republican support with a fundraiser hosted by former President George W. Bush. He was also joined by Vice President Pence on the campaign trail, but not Trump.

The Trump-referendum strategy has not been particularly successful for Democrats in House special elections this year, which the president referenced in his tweet Tuesday night. He referred to special elections in Kansas, Montana, Georgia, and South Carolina—Republicans won all four of those races.