President Donald Trump insists that there’s a national emergency at the “very dangerous southern border.”

He’s called it an “invasion” of undocumented immigrants endangering the lives and livelihoods of hardworking American citizens. And he’s used this narrative to justify taking billions of dollars from the US military to build a border wall.

But when a reporter disputed Trump’s claims earlier this month, Trump only made vague assertions about having “many stats” to back it up.

The president then repeated one of his most outrageous lies: that undocumented immigrants cost US taxpayers a ton of money.

“Billions and billions of dollars a month,” he said. “Billions and billions of dollars. And it’s unnecessary.”

I’ve written before about how false — and pervasive — this myth is. That, in fact, undocumented immigrants contribute billions of dollars in federal taxes each year, and their income taxes and payroll tax dollars are keeping Social Security and Medicare solvent.

But it’s also worth noting that undocumented immigrants are paying billions of dollars in state and local taxes each year — in all 50 states.

While it’s impossible to get the exact numbers because of the limited data available, researchers at the left-leaning Institute on Taxation & Economic Policy estimate that undocumented workers paid a total of $11.7 billion in state and local taxes in 2014, the most recent year of data, according to their 2017 report.

That includes $7 billion in sales taxes and excise taxes, which are those paid on specific items like gas sales and vehicle registrations. Undocumented immigrants, like everyone else, pay for highway repairs, state courts, police, and firefighters. They also paid about $1.1 billion in state income taxes and $3.6 billion in property taxes that year — money that funds public schools, garbage collection, and other city services.

Undocumented workers contribute the most tax dollars to states with the largest populations: California, Texas, and New York. Yet some states that benefit the most from their tax money are red and blue states that Trump won in 2016: Florida, Georgia, Texas, North Carolina, and Arizona.

According to the report, the 10 states that benefited the most from undocumented taxpayers in 2014 are:

California, $3.2 billion

Texas, $1.6 billion

New York, $1.1 billion

Illinois: $758,881,000

Florida, $598,677,875

New Jersey, $587,415,000

Georgia, $351,718,000

North Carolina, $277,402,000

Virginia, $255,965,000

Arizona, $213,574,000.

These numbers suggest that the president’s anti-immigrant policies could end up hurting communities that depend on this source of tax revenue.

The numbers are also a stark contrast with public perception about the cost of illegal immigration — especially among Trump voters. About 69 percent of Trump supporters surveyed in 2016 said immigrants are a burden to the United States.

Data on immigrant tax contributions isn’t perfect

It’s important to keep in mind that these numbers are just estimates, but they’re the best that exist. To come up with state and local tax contributions, economists at the Institute on Taxation & Economic Policy crunched data from the US Census Bureau and the Migration Policy Institute to determine the likely number of undocumented immigrants in each state, their average incomes, and their homeownership rates. Researchers used that data to calculate how much they pay in sales tax, property taxes, and excise taxes, based on tax rates in each state.

It’s most difficult to estimate how much undocumented workers pay in state income taxes. The IRS withholds taxes from immigrants hired with fake Social Security numbers, but workers who get paid in cash could simply choose not to report their income, unless they voluntarily file a return with an Individual Taxpayer Identification number, which is also common.

Past research has determined that the share of unauthorized workers who pay income taxes is anywhere from 50 percent to 75 percent, so the report uses the most conservative estimate: 50 percent.

Overall, researchers said undocumented immigrants paid an effective tax rate of 8 percent in state and local taxes, compared to the 5.6 percent top tax rate. They paid the highest tax rates in Washington, 10.7 percent, and Illinois, 10.3 percent.

Unauthorized workers also fund the federal government

Undocumented immigrants pay even more federal taxes than state taxes.

Millions of undocumented immigrants file tax returns each year, and they are paying taxes for many benefits they can’t even use.

The most recent IRS data, from 2015, shows that the agency received 4.4 million income tax returns from workers who don’t have Social Security numbers, which includes a large number of undocumented immigrants. That year, they paid $23.6 billion in income taxes. That doesn’t even include workers who paid taxes with fake Social Security numbers on their W-2 forms, which is also common.

These undocumented workers pay taxes for benefits they can’t access, like Social Security and Medicare. They also aren’t eligible for benefits like the Earned Income Tax Credit. But the IRS still expects unauthorized immigrants to file their taxes, and many of them do so.

There’s a clear reason why. Filing taxes helps immigrants create a paper trail to show when they entered the country and how long they’ve been contributing tax dollars. Many are hoping it will help them get legal status one day. That has happened in past reform efforts, and one of the first requirements is usually to prove that a person has been paying taxes. That was the case for the undocumented youth granted temporary work permits under President Barack Obama’s Deferred Action for Childhood Arrivals deportation relief program.

So despite the political rhetoric, undocumented immigrants are not a drain or burden on the government. In fact, it’s quite the opposite.

How unauthorized immigrants pay their taxes

There are two ways undocumented immigrants pay taxes. First, they pay federal taxes using fake Social Security numbers on their W-2 forms.

Second, some file income tax returns each year with an Individual Taxpayer Identification Number (ITIN), created by the IRS in 1996 so people who aren’t allowed to work in the United States could still file taxes on any income they earned.

Workers who get a paycheck still have payroll taxes for Medicare and Social Security withheld from their paycheck, even if they put a fake Social Security number on their W-2 form. The IRS estimates that unauthorized workers pay about $9 billion in payroll taxes annually.

A portion of the payroll tax withheld from undocumented immigrants — like all workers — goes to the retirement trust fund at the Social Security Administration. In 2013, the agency reviewed how much money undocumented workers contributed to the retirement trust fund. The number was astonishing: $13 billion in one year.

The chief actuary of the Social Security Administration, Stephen Goss, estimates that about 1.8 million immigrants were working with fake or stolen Social Security cards in 2010, and he expects that number to reach 3.4 million by 2040.

“We estimate that earnings by unauthorized immigrants result in a net positive effect on Social Security financial status generally,” Goss concluded in the 2013 review.

President Trump doesn’t seem interested in the government’s own data. After all, it doesn’t support his claim that illegal immigration has created a national emergency. Because it hasn’t.