"The off-year is always unpredictable."

The words of President Joe Biden when asked if he was concerned that his candidate, Democrat Terry McAuliffe, was going to lose the Virginia governor's race.

While acknowledging the election would be tight, he said he believed Mr McAuliffe would win but it wasn't to be.

Glenn Youngkin was projected to claim victory, the first Republican elected to statewide office in Virginia since 2009.

It followed a campaign that had a strong focus on education amid rows over how schools should deal with issues such as race and enforcing mask mandates.

Terry McAuliffe was criticised for comments he made during a debate when he said: "I don't think parents should be telling schools what they should teach."

Defeat of Terry McAuliffe is a blow to President Joe Biden

The Virginia governor's race was seen by many as a referendum on Joe Biden's first year in office.

He comfortably won the state in the presidential election but 12 months on, voters there have backed a Republican candidate for Governor.

The result is a blow to Mr Biden whose approval ratings have fallen in recent months following the chaotic withdrawal from Afghanistan, rising inflation, a slow recovery from the pandemic and a legislative agenda that has stalled on Capitol Hill.

Democrats tried to damage Mr Youngkin by portraying him as a Donald Trump candidate and last night the former president took credit for the victory, saying that his base had come out in force and that his movement was bigger and stronger than ever.

Glenn Youngkin kept Donald Trump at arm's length in his campaign

"Thank you to the people of the Commonwealth of Virginia and most particularly, to our incredible MAGA voters!" he said in a statement.

Donald Trump endorsed Mr Youngkin, but the Republican candidate kept the former president at arm's length.

He didn't invite Mr Trump to campaign with him and he avoided questions about his more controversial and divisive views.

It is a balancing act that could well become a blueprint for other Republican candidates who need Donald Trump's support base, but risk alienating moderate, suburban voters among whom the former president remains deeply unpopular.

While this was an 'off-year' election, it will leave Democrats very worried ahead of the midterms in 2022 when control of the US Congress will be up for grabs.