President Biden won the White House because the coronavirus let him stay hidden in his basement, protecting his campaign from its biggest liability — the candidate himself, a new book says.

The Biden camp ran partly on the strategy of "you put your dumb uncle in the basement,’’ referring to the Democratic candidate, according to "Lucky: How Joe Biden Barely Won the Presidency.’’

Even former President Obama initially refused to support his 78-year-old ex-vice president and friend, worried he could become a "tragicomic caricature of an aging politician having his last hurrah’’ if not protected from himself, the book says.

President Joe Biden speaks about efforts to combat COVID-19, in the State Dining Room of the White House, Tuesday, March 2, 2021, in Washington.  (AP)

The work’s authors — Jonathan Allen of NBC News and Amie Parnes of The Hill — write that time and again, "the stars aligned’’ for Biden, a previous two-time loser presidential hopeful who succeeded on his third try despite himself.

And no one was more caught off guard than the Trump camp.

The tome says that in May, Trump watched Biden give a CNN interview and afterward asked top aide Kellyanne Conway, "What do you think?’’

Conway replied, "I think if we lose to him, we are pathetic,’’ the book says.

Trump laughed, say the book’s authors, who also wrote "Shattered’’ about Hillary Clinton’s failed presidential bid in 2016.

"Until the COVID thing came, we were winning four hundred electoral votes,’’ a source familiar with Trump’s internal numbers around February 2020 claimed to the authors.

Even one of Biden’s top advisers, Anita Dunn, allegedly told an associate at one point, "COVID was the best thing that happened to him."

BIDEN SAYS COVID-19 VACCINES WILL BE AVAILABLE FOR ALL US ADULTS BY END OF MAY

In mid-March 2020, Biden’s team converted the basement of his home in Wilmington, Del., into a makeshift studio from which he could safely issue statements.

"They used coronavirus as an excuse to keep him in the basement, and it was smart,’’ a Trump adviser told the authors.

"Biden was able to hide his biggest weakness, which is himself. And he did it with an excuse that sounded responsible."

But Biden’s broadcast the night of the March 17 primaries was just bizarre, the book says.

"There was a hostage-video quality to the broadcast. It was cloudy and dark," the book describes.

"As he spoke, there was an ever-so-slight time delay, putting Biden’s words out of sync with the movements of his mouth. This was the guy who would send Donald Trump to Mar-a-Lago for good?"

One Biden aide told the authors, "I cringed the entire time. He looked like he didn’t know what he was doing.’’

Meanwhile, Obama "seemed to be enamored with former Texas congressman, Beto O’Rourke,’’ as a presidential contender, although he eventually put his clout behind his former vice president, who he once likened to a brother, the book says.

And by fall, Trump had become "his own invisible enemy,’’ the book says.

"With less than month to go until the election, Trump had just come off a debate performance in which he’d managed to make the challenger look more presidential, he was low on cash, he was discouraging Republicans from voting by mail, he had contracted a disease that had killed more than two hundred thousand of his fellow Americans, and he was ignoring advice to show just an ounce of humanity,’’ the authors write.

CLICK HERE TO GET THE FOX NEWS APP

"He couldn’t see he was hurting himself.’’

Within a month, Biden would have won the presidency with "a bland message and a blank agenda,’’ the authors say.

Reps for the president did not immediately respond to a request for comment from The Post on Tuesday.

To read more from The New York Post, click here.