President Barack Obama considered Donald Trump’s election a personal insult by voters seeking to destroy his legacy by electing a “buffoonish racist,” according to a book excerpt.

Excerpts of the New York Times writer Peter Baker’s “Obama: The Call of History” published by the Daily Mail allege that Obama was overcome with anger when Hillary Clinton lost her 2016 bid for the White House.

Obama also reportedly called Clinton’s effort a “scripted, soulless” campaign.

“Obama may not have been on the ballot, but it was hard not to see the vote as a ‘personal insult,’ as he had called it on the campaign trail,” Baker wrote in his newest update.

Baker added that Obama sighed, “This stings, this hurts” after Trump won the night on Election Day, and he ultimately felt that America had “turned on him.”

Obama despaired thinking that the American people “simply could not have decided to replace him with a buffoonish showman whose calling cards had been repeated bankruptcies, serial marriages, and racist dog whistles.”

But Clinton also came in from some vituperative comments, Baker said.

Along with calling her campaign “soulless,” Obama went to say, “No one forced her to take hundreds of thousands of dollars from Goldman Sachs and other pillars of Wall Street for speeches,” Obama said, according to Baker. “No one forced her to run a scripted, soulless campaign that tested eighty-five slogans before coming up with ‘Stronger Together.'”

Above all, Obama seemed angry that Clinton was left cooling her heels in Chappaqua while Trump was set to roll into Washington to begin dismantling the Obama legacy.

While he jumped into the campaign for candidates in the 2018 midterms, thus far, the former president has resisted backing any of the nearly two dozen Democrat candidates for president in 2020, one of whom is his own vice president. Many of the candidates he supported in 2018 lost their elections, especially those in close races.

Follow Warner Todd Huston on Twitter @warnerthuston.