As Congress debates immigration reform, some would have us believe that immigrants are draining the Treasury. But it turns out that closing the borders would deplete Medicare’s trust fund.

We, along with colleagues at Harvard Medical School, studied who pays into the Medicare trust fund vs. who uses Medicare coverage. As we report in the current issue of the journal Health Affairs, over a seven-year period, immigrants paid in $115.2 billion more than they took out. Meanwhile, native-born Americans drained $28.1 billion from Medicare. In other words, immigrants are keeping Medicare afloat. And it’s non-citizen immigrants who make the biggest contribution. On average, each one subsidizes Medicare by $466 annually.

It’s not just Medicare that profits from immigrants. Social Security’s chief actuary estimated that undocumented immigrants contributed a net surplus of $12 billion to the Social Security retirement trust fund in 2007 alone.

In essence, without immigrants’ contributions, the financial pressure on Medicare and Social Security would be far greater, and threatened cuts for the elderly far more severe.

Why do immigrants generate surpluses for Medicare and Social Security? Most of them are young, working adults, who pay the payroll taxes that feed the trust funds. Immigrants with legal status pay these taxes under valid Social Security numbers. Many undocumented immigrants also pay these taxes, under invalid or borrowed Social Security numbers (under federal law, employers must report, but needn’t verify, a Social Security number for each employee). Meanwhile, most immigrants are too young to draw Medicare benefits. Even once they pass 65, many don’t qualify for benefits because they lack legal status or proof of their payroll tax contributions. And others retire to their country of origin.

While immigrants heavily subsidize Medicare, millions of them are denied care. Our research has found that foreign-born children get shockingly little care, often skipping routine well-child visits. And immigrant adults with mild conditions such as hypertension often don’t get the care they need to prevent serious (and expensive) complications such as strokes and heart attacks.

But dry statistics don’t tell the story. We’ve cared for a young immigrant mother who died of tuberculosis shortly after giving birth; out of fear, she had avoided earlier lifesaving care. Another of our patients, a 47-year-old immigrant truck driver, stayed home for two days with heart attack symptoms and died because he never got the clot-busting drugs that could have saved him. Some patients work two, even three, jobs but remain uninsured and unable to afford care.

What should Congress and the president do? In the short term, cuts to Medicare Disproportionate Share funding for safety net hospitals (Sections 2551 and 3133 of the Affordable Care Act) should be reversed; support for community and migrant health centers needs to be amped up; and restrictions on immigrants’ enrollment in public programs such as Medicare and Medicaid should be lifted. In the longer term, only a truly universal, single-payer program will do.

And Obamacare won’t do much to help. Even many legal immigrants won’t be eligible for Medicaid and will be prohibited from buying coverage through the new insurance exchanges. Meanwhile, Obamacare will sharply cut funding for safety net hospitals, threatening the solvency of institutions that will care for the 31 million (including 8 million immigrants) who will remain uninsured. The effect will be especially severe in places such as New York City and Los Angeles, where nearly 2 of every 5 residents were born outside the U.S.

Scare-mongering about the cost of immigration has become a staple of political debate. We started our research on immigrants’ health because as doctors we believe that health care is a human right, a right that we too often saw violated even in liberal Massachusetts. But our findings indicate that economic fairness, not just morality, argues for immigrants’ rights to care.

Steffie Woolhander and David U. Himmelstein are internists, professors at the City University School of Public Health at Hunter College and visiting professors of medicine at Harvard Medical School.