But even presidents with more evident interest have tripped up over history from time to time. Mr. Obama mangled World War II events when he said his great-uncle helped liberate Auschwitz, which would have been possible only if his great-uncle had been a Soviet soldier. Aides later clarified that Mr. Obama meant Buchenwald, which was liberated by American troops. Similarly, when Mr. Obama referred to “Polish death camps,” he generated a storm of protest in Warsaw, which always insists that they be referred to as German death camps on Polish territory.

Mr. Trump has made questionable comments a regular feature of his public discourse, going back years. During the campaign, he talked about thousands of Muslims in the United States cheering after the attacks of Sept. 11, 2001, despite a lack of evidence. At a golf course in Virginia, he posted a plaque honoring the “River of Blood” where so many soldiers died in the Civil War that “the water would turn red,” even though historians said no such battle took place there.

At an African-American History Month celebration in February, Mr. Trump seemed to suggest that the 19th-century abolitionist Frederick Douglass was still around. “Frederick Douglass is an example of somebody who’s done an amazing job and is being recognized more and more, I notice,” he said.

At a later fund-raiser for the National Republican Congressional Committee, he seemed surprised that Lincoln belonged to the Republican Party. “Great president,” he said. “Most people don’t even know he was a Republican, right? Does anyone know? Lot of people don’t know that.”

No doubt many Americans are not fully aware of the country’s history, but most do know Lincoln was a Republican, according to a Pew Research Center survey in 2012. Fifty-five percent of those polled correctly said Lincoln was a Republican. Still, perhaps Mr. Trump was thinking about the 28 percent who thought the Great Emancipator was a Democrat.

Even his staff has found trouble over historically loose comments. Sean Spicer, the White House press secretary, asserted at a briefing that Hitler did not use chemical weapons against his own people. Mr. Spicer quickly apologized.