WASHINGTON — America was on the brink of war. As President Barack Obama prepared to leave office, he was contemplating yet another conflict in Asia, where the United States had already fought twice since the 1950s without winning. This time, the enemy had nuclear weapons. The potential for devastation was enormous.

Wait a minute — don’t remember Mr. Obama’s near-war with North Korea? Neither do the people who were working for Mr. Obama at the time.

But President Trump has been telling audiences lately that his predecessor was on the precipice of an all-out confrontation with the nuclear-armed maverick state. The way Mr. Trump tells the story, the jets were practically scrambling in the hangars.

“I believe he would have gone to war with North Korea,” Mr. Trump said in the White House Rose Garden on Friday. “I think he was ready to go to war. In fact, he told me he was so close to starting a big war with North Korea.”