Just after President Trump extolled his record on gun rights on Tuesday evening, his State of the Union address took a wild, westward turn into an idea that’s long been relegated to the history books.

“In reaffirming our heritage as a free nation, we must remember that America has always been a frontier nation,” he told members of Congress, about three-quarters of the way through his speech. “Now we must embrace the next frontier: America’s manifest destiny in the stars.”

Minutes later, some people on social media were alarmed. The phrase is anything but politically correct, on the left at least. And Trump and his base enjoy pushing the left’s buttons.

“Did @realDonaldTrump just cite manifest destiny to argue we should colonize the moon?” Abdul El-Sayed, former Democratic candidate for governor of Michigan, asked on Twitter.

As a historical concept, manifest destiny would be familiar to any student of AP U.S. history: To make the case for westward expansion, many Americans in the mid-19th century argued that the nation had a God-given responsibility to push its territorial footprint farther, lest the American experiment die out.

Back then, it was a kind of veneer to make the whole thing seem nobler: A justification for protecting the country’s perceived interests even if it meant destroying many of the people and much of the environment in its path.

On Tuesday, however, manifest destiny proved to be a kind of Rorschach test for politicos on either side of a polarized Washington. (This time, NASA was involved.)

Chiraag Bains, the director of legal strategies at the liberal think tank Demos, criticized its use in the State of the Union, saying that manifest destiny was “the white man’s right to conquer all of North America, used to justify the killing and removal of Native peoples.”

Jim Morhard, NASA’s deputy administrator, offered a very different definition on Twitter. Manifest destiny, he said, “was the belief that the United States was destined to promote democracy & free enterprise across North America.”

Well, not quite.

Steven E. Woodworth, a history professor at Texas Christian University and the author of “Manifest Destinies: America’s Westward Expansion and the Road to the Civil War,” told The Washington Post late on Tuesday that Trump’s use of the concept seemed to be an attempt to sell space exploration in a way that might appeal to his supporters’ ideas of frontier-era nostalgia.

Indeed, the president sprinkled related ideas throughout the State of the Union address and often fused them with his galactic ambitions: the vast frontier. Braving the unknown and taming the wilderness. Planting the American flag on Mars and sending 13-year-old Iain Lanphier from Arizona into space. The Wild West.

“He’s touching all of the buttons you can push to light up the dashboard of American heritage,” Woodworth said, and invoking an idea that the president’s supporters “would associate with being strong, independent and self-reliant."

Near the end of his speech on Tuesday, Trump said that “the American nation was carved out of the vast frontier by the toughest, strongest, fiercest and most determined men and women ever to walk on the face of the Earth."

That’s not quite right either, Woodworth said. Those who went westward may have been fleeing the law farther east, or been down on their luck and in search of better economic fortunes. Over the course of 30 years, 400,000 people sold what they had and moved west of the Mississippi River.

Yet Trump’s address pulled from popular American conceptions — or at least some people’s conceptions — of frontier life, which have seeped into how we think of the idea of manifest destiny today. In popular terms, then, it’s all evolved over the past century and a half.

The term was coined by journalist John O’Sullivan in 1845, as a way to marshal up popular support for the United States to annex the Republic of Texas.

It was the nation’s “manifest destiny,” O’Sullivan wrote, to carry the “great experiment of liberty” as far west as it might go: to “overspread and to possess the whole of the [land] which Providence has given us."

However, it wasn’t until his second use of the term, advocating for negotiations with Britain over Oregon Country, that it really stuck. By then, the Pacific was already in sight for the growing nation.

Woodworth said that timeline may be a key difference compared to the goal of planting the American flag on Mars, as Trump declared on Tuesday. When O’Sullivan called for the annexation of Texas, the idea of a transcontinental United States was realistically only a few years away. Indeed, by the Gadsden Purchase of 1853, the contiguous United States became what it looks like today.

So while Trump may have called the United States “a frontier nation,” Woodworth said that label has not really applied in well over a century. By 1890, the U.S. Census Bureau announced that so many people had filled in throughout the West that there was no longer a meaningful frontier line.

And besides, Woodworth asked: Does Trump himself even know what manifest destiny means?