Former President Barack Obama reprimanded his own former White House physician for criticizing Joe Biden's cognitive health on the 2020 presidential campaign trail, according to a forthcoming book.

In his memoir "Holding the Line: A Lifetime of Defending Democracy and American Values," Rep. Ronny Jackson, R-Texas, writes about a stern email from Obama about then-presidential candidate Biden’s "crazy statements and concerning mental gaffes" — a criticism he was uniquely qualified to make having served as the White House physician to Presidents George W. Bush, Obama and Donald Trump.

"Biden was on TV again, making crazy statements and concerning mental gaffes; he didn’t know what state he was in or what office he was campaigning for," Jackson recalls of the 2020 campaign season. "He apparently thought at one point that he was running for the Senate and later couldn’t remember what state he was campaigning in. This had been going on for months and was getting worse."

For years, the media had accused Trump of being mentally unwell, and in 2018 many commentators mocked Jackson for saying that a cognitive evaluation Trump had taken showed he was in "excellent" mental shape and "had absolutely no cognitive or mental issues whatsoever." 

WHITE HOUSE PRESS SECY LAUGHS OFF QUESTION ABOUT BIDEN'S HEALTH: 'NOT A QUESTION WE SHOULD BE ASKING'

Barack Obama and Joe Biden in cabinet meeting

Former-President Barack Obama and then-Vice President Joe Biden participate in a cabinet meeting at the White House in Washington, D.C., on June 8, 2009.    REUTERS/Jason Reed/File Photo (REUTERS/Jason Reed/File Photo)

"Trump never made crazy statements like the ones Biden was making almost every day," Jackson writes in his book, "but these people were jumping up and down: ‘He’s not fit to be president; he needs a cognitive test!’" 

In 2020, when Jackson himself was running for Congress, the media’s lack of attention to Biden’s cognitive frailty bothered him greatly. He retweeted a video of Biden’s "latest cognitive misadventure" with the message: "Remember the cognitive test that I gave @realDonaldTrump? The one he aced! Sounds like somebody else might need some testing done!! Scary!!"

Within 20 minutes of that tweet, Jackson received a "scathing" email from President Obama. 

"I have made a point of not commenting on your service in my successor’s administration and have always spoken highly of you both in public and in private. You always served me and my family well, and I have considered you not only a fine doctor and service member but also a friend," Obama wrote in the email. 

Ronny Jackson, former White House physician

White House physician Dr. Ronny Jackson speaks to reporters during the daily briefing in the Brady press briefing room at the White House in Washington, D.C. on Jan. 16, 2018. (Photo by Jabin Botsford/The Washington Post via Getty Images) (Jabin Botsford/The Washington Post via Getty Images)

REPUBLICANS URGE BIDEN TO TAKE COGNITIVE TEST, SAY HIS 'MENTAL DECLINE' HAS 'BECOME MORE APPARENT'

"That’s why I have to express my disappointment at the cheap shot you took at Joe Biden via Twitter. It was unprofessional and beneath the office that you once held. It was also disrespectful to me and the many friends you had in our administration. You were the personal physician to the President of the United States as well as an admiral in the U.S. Navy. I expect better, and I hope upon reflection that you will expect more of yourself in the future," Obama told Jackson.

Obama sent an email to Ronny Jackson on Biden's mental health

Image of an email from former President Barack Obama to Ronny Jackson (Courtesy of Ronny Jackson/Post Hill Press)

Surprised and flustered by the email, Jackson ultimately chose not to respond. Jackson recalls considering whether to call the former president, but a friend of his, radio host and conservative commentator Dan Bongino, reminded him that Obama did nothing while Jackson was in the midst of a Senate confirmation fight to be Trump's secretary for the Department of Veterans Affairs

"So, upon reflection, I thought, You know what? Screw that guy! I’m not doing it," Jackson wrote. "I just walked away from it, which was the last time I had any contact with [Obama]," Jackson wrote. Obama did not respond to Fox News Digital's request for comment.

"It’s awfully ironic now, considering [Biden’s mental fitness] is all anyone, including the liberal media, can talk about," Jackson told Fox News Digital. 

CLICK HERE TO GET THE FOX NEWS APP

"Let it be known, as the White House physician for the last three presidents, I was the first to say that we have a serious problem with this man’s cognitive demise, and he will not make it four years in office. I’ve always said there would come a point where it wouldn’t be just me talking about it, but his own party, and sadly, that has proven to be the case. Joe Biden’s cognitive failures are on full display for the whole world to see," Jackson said.

"Holding the Line," which chronicles Jackson’s journey to the White House as a Navy physician, his relationships with the three presidents that he served and his early political career at a time when the political left was determined to destroy him, comes out on July 26.