Donald Trump has repeatedly said immigrants living illegally in the United States have it better than veterans who have served the country.

He said it over Memorial Day weekend at a rally honoring prisoners of wars and troops missing in action, during a speech in Arizona outlining his immigration plan and most recently at the Union League of Philadelphia, which supports veterans and their families.

"Our veterans, in many cases, are being treated worse than illegal immigrants, people that come into our country illegally," Trump said Sept. 7.

His campaign stuck by the claim, offering evidence he is right. We decided to take a deeper look.

The Trump campaign’s argument

In an email, the Trump campaign claimed that many politicians give more attention and pledge more support to those in the country illegally than to veterans.

Specifically, Trump’s campaign said Hillary Clinton "downplayed" the Department of Veterans Affairs scandal about veterans waiting for months for medical care. (We rated Mostly False a claim by Trump that Clinton is "satisfied" with the VA.)

They also noted that she has not demanded "the introduction of a massive veterans benefits bill her first 100 days as president." Instead, she said pledged "to fight for illegal immigrants and spend taxpayer dollars granting them benefits, such as Obamacare, Social Security, and Medicare." (We rated a similar claim by Trump Mostly False that Clinton has pledged amnesty in her first 100 days and to provide Obamacare, Social Security and Medicare for undocumented immigrants.)

Trump’s campaign also pointed to a 2008 Washington Post article noting that a man had previously been convicted of drunken driving but not questioned about his immigration status. He later killed two people while drunk and speeding, and sentenced to 24 years in prison.

"Illegal immigrants convicted of DUIs are often released without any immigration consequences," Trump’s press team wrote. "But members of the military who receive DUIs are subject punishment from their commanding officers and court martial."

The campaign also said that in terms of financial resources, billions of dollars are spent at all levels of government on undocumented immigrants, about $950 million were budgeted for fiscal year 2016 to care for children who entered the country illegally without their parents, cost to house undocumented immigrants in prisons in fiscal year 2014 was $1.87 billion.

Other than the anecdote about the DUI case, we’re not sure any of these examples show how veterans are being treated worse than people living in the United States illegally.

So we decided to directly compare the two groups using things Trump often talks about -- education, health care and tax and fiscal policy.

Education

In terms of K-12 public education, the Supreme Court ruled in 1982 that no one can be denied access, even if they are undocumented, said Irene Bloemraad, a sociology professor at the University of California.

That equal access also applies to veterans, but presumably veterans are not seeking K-12 education, Bloemraad said. "At best, we can conclude no advantage, one way or another, at this level of education," she said.

That Supreme Court ruling does not apply to post-secondary education and it’s up to states to set the rules regarding undocumented immigrants’ access to public colleges and universities, Bloemraad said.

Two states -- Alabama and South Carolina -- bar undocumented students from enrolling in public postsecondary institutions. Georgia’s State Board of Regents does not allow undocumented students to enroll in selective public universities (institutions that admit fewer than apply), according to University Leaders for Educational Access and Diversity Network.

"Veterans would presumably face no ban to enrolling," Bloemraad said. "So clearly, veterans are not treated worse; rather, in some states undocumented students are in a much more difficult position."

A veteran resident can also pay in-state tuition rates and can apply for federal benefits for post-secondary education, she said.

Higher education and training benefits are available to veterans, servicemembers and their families through federal programs such as the Post-9/11 GI Bill.

Undocumented students are not eligible for federal financial aid. In some states, undocumented students are required to pay higher, out-of-state rates for their education, even if they have lived in that state most of their life, Bloemraad said.

Overall: Advantage veterans.

Medical care

The Emer­gency Med­ical Treat­ment and Active Labor Act, enacted by Congress in 1986, provided that hospitals provide anyone emergency care until stabilized, said Gail Wilensky, former head of Medicare and Medicaid under President George H.W. Bush.

So undocumented immigrants, by law, can get immediate emergency care -- but so can veterans. In this regard, both groups are treated the same in case of medical emergencies.

Undocumented immigrants are not eligible to buy health coverage through the Affordable Care Act.

Veterans enrolled in the Veteran’s Affairs health care system (about 9 million of the 22 million veterans) are not eligible for the Affordable Care Act, but others would be -- unless they are eligible or have other coverage such as Medicare or employer-sponsored insurance, Wilensky said.

Still, veterans are eligible for medical care.

It’s "hard to think of an example where an illegal immigrant would get better care," Wilensky said. Some of the Veterans Affairs care is clearly substandard or delayed, but that’s a different problem, she said.

Katherine Baicker, a health economist at the Harvard University, said there are limits to the programs and care available to undocumented immigrants. They are not eligible for Medicaid, for instance, she said.

Veterans are eligible for Medicaid and those who qualify usually do not pay copays for Veterans Affairs health care, according to the Veterans Affairs Department.

"I can't think of ways in which veterans have less access or lower quality care than undocumented immigrants," Baicker said.

Overall: Advantage veterans.

Taxes, Social Security

Veteran’s benefits generally are not subject to tax and many tax provisions benefit service members, said Roberton Williams, senior fellow at the Urban Institute-Brookings Institution Tax Policy Center.

Pay earned while serving in a combat zone is exempt from federal income tax, he said.

"I can't think of any tax issue that would hit troops harder than undocumented immigrants," Williams said.

Veterans are entitled to Social Security benefits.

Laws enacted in 1996 and 2004 block Social Security benefits paid to unauthorized immigrants or to any noncitizen without a work-authorized Social Security number at some point in time, according to the Social Security Administration.

As the Associated Press has also noted, undocumented immigrants don’t have the right to vote, don’t have legal permission to work or to receive most government benefits.

Veterans who are citizens have the right to vote, have job employment resources such as the Veterans Employment Center and may qualify for Veteran Affairs health benefits.

Overall: Advantage veterans.

Our ruling

Trump said, "Our veterans, in many cases, are being treated worse than illegal immigrants."

In some states undocumented immigrants are barred from enrolling in post-secondary institutions, or pay out-of-state tuition even if they’ve lived in that state most of their lives; veterans are eligible for federal benefits for higher education and training and are eligible for in-state tuition. Undocumented immigrants also aren’t eligible for Medicaid, cannot buy coverage through the Affordable Care Act and cannot receive Social Security benefits, all of those services and benefits are available to veterans.

Veterans also have the right to vote and are eligible for federal job placement resources.

Veterans are entitled to several more benefits that are not offered to civilians, much less undocumented immigrants.

We rate Trump’s statement False.