Border Patrol agents search the Rio Grande River for illegal immigrants crossing the border. (Loren Elliott/AFP/Getty Images)

PRESIDENT TRUMP’S failure to secure funding for his new “beautiful” border wall has prodded him to new flights of rhetorical excess and deviation from fact. In the latest iteration, the president denounces Democrats and Mexicans for what he calls a “dangerous” immigration flow. The truth is that illegal entry at the southwest border is at its lowest level in nearly half a century. The last year the Border Patrol apprehended fewer unauthorized immigrants, 1971, Richard Nixon was in the White House, a gallon of gas cost 36 cents and Disney World’s Magic Kingdom opened in Orlando.

In the magic kingdom of Mr. Trump’s worldview, Central Americans are flooding northward through Mexico to “take advantage of DACA” — Deferred Action for Childhood Arrivals, the Obama-era policy that granted temporary protection from deportation to young immigrants brought as children to the United States. In truth, illegal border crossing has dropped for years as Mexico’s economy has improved and the United States has beefed up the southwest frontier with physical barriers, better technology and thousands of additional Border Patrol officers.

The best measure of illegal immigration flows on the southwest border — Border Patrol arrests on the Mexican frontier — fell from roughly 700,000 in fiscal 2008, when Barack Obama first ran for presidential office, to 409,000 in fiscal 2016, when he was about to depart. Apprehensions plunged further in fiscal 2017 after Mr. Trump took over, to 304,000, a 46-year low. The numbers have remained low in the current fiscal year.

The president never mentions that long-term drop, preferring to conjure the frightening image of a porous border overrun with drug runners and criminals — the better to press his case for a $25 billion wall. Democratic leaders in Congress offered Mr. Trump $25 billion in return for a path to citizenship for about 1.8 million DACA-eligible young immigrants. The president refused the deal; on Tuesday he said he’ll deploy the military to reinforce border security.

Mr. Trump declares DACA dead, suggesting it was the magnet for a so-called caravan of 1,200 or so Central Americans that was making its way northward through Mexico as evidence that the program is a draw for “big flows of people.” In fact, no one who arrived in the United States after June 2007 is eligible for DACA.

Mr. Trump simultaneously threatens to end the North American Free Trade Agreement unless Mexico blocks illegal border crossings and drug flows, overlooking the risk that killing NAFTA could weaken Mexico’s economy — and trigger higher illegal immigration.

While the president harps on a problem that does not exist — a weak border — he ignores a problem that does: the United States’ aging population and workforce, long-term trends that are likely to generate demand for more immigrant workers, not fewer. The share of Americans age 65 and older has increased sharply since the turn of the century and is expected to continue growing for years. Economists say an aging workforce erodes productivity over time, meaning it is in the United States’ interest to allow more young immigrants with their energy and ambition to invigorate the economy. Mr. Trump is determined to do the opposite.