President Donald Trump, though he was many times zones away in South Korea, was quick to throw Ed Gillespie overboard on Tuesday night once it became clear the Republican nominee for Virginia governor was a loser. Enjoying the newfound expressive potential of 280 characters, Trump tweeted:

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! — Donald J. Trump (@realDonaldTrump) November 8, 2017

This was a decidedly different message than earlier in the day, when the president championed Gillespie’s Trumpian fear-mongering over crime and immigration:

.@EdWGillespie will totally turn around the high crime and poor economic performance of VA. MS-13 and crime will be gone. Vote today, ASAP! — Donald J. Trump (@realDonaldTrump) November 7, 2017

The two tweets may seem contradictory, but they both contain an element of truth. The relationship between Trump and Gillespie is a complicated one. Gillespie—a former chair of the Republican National Committee, aide to President George W. Bush, and senior advisor in Mitt Romney’s 2012 presidential campaign—was not the most Trumpian candidate in Virginia. Corey Stewart ran against Gillespie in the Republican primary with a campaign that The Washington Post editorial board described as mix of “bombast, nativist venom and red-meat, race-tinged pandering”—and lost to Gillespie by just 1.2 percent. Gillespie took this as evidence that he should adopt Stewart’s brand of Trumpian populism, on the assumption that it would energize the state’s Republican base in an off-year election. That’s how Gillespie, hitherto a dull establishment Republican, started fighting culture wars on sanctuary cities, immigration, and crime.

Gillespie ran a campaign best described as Trumpism Without Trump, and the fact that he lost handily suggests that Republicans are in for a bruising year in 2018, when Trump’s name won’t be on the midterm ballots.

Gillespie’s strategy, as described by Michael Scherer and David Weigel in the Washington Post, was a simple one: “Run a mainstream candidate who could nonetheless employ the racially-charged, culture-war rhetoric of President Trump to drive out the white, working-class base.” Despite his moderate background, Gillespie played the role convincingly. “A onetime establishment stalwart, Ed Gillespie, declined to campaign with Trump—but he executed on the plan as well as he could,” Scherer and Weigel wrote. “He defended Confederate memorials, vilified Central American gangs in ads that looked like horror movies and even denounced the kneeling protests of professional football players.” Steve Bannon, Trump’s former campaign CEO, hailed Gillespie’s rightward turn. “Corey Stewart is the reason Gillespie is going to win,” he assured the Post over the weekend. “It was the Trump-Stewart talking points that got Gillespie close and even maybe to victory. It was embracing Trump’s agenda as personified by Corey’s platform.”