Texas Sen. Ted Cruz has talked tough on immigration, saying he would deport all 12 million undocumented immigrants.

CNN’s Wolf Blitzer asked Cruz what is wrong with letting the "good ones" come back to the United States during the Feb. 25 GOP debate in Houston.

Cruz referenced a Feb. 9 Wall Street Journal article and said Arizona’s strict immigration laws have prompted undocumented immigrants to flee the state. As a result, it has become tougher for business owners in the state to find skilled workers, but at the same time state spending decreased.

"Arizona put in very tough laws on illegal immigration, and the result was illegal immigrants fled the state. ... Some of the business owners complained that the wages they had to pay workers went up, and from their perspective that was a bad thing. But what the state of Arizona has seen is the dollars they're spending on welfare, on prisons, and education, all of those have dropped by hundreds of millions of dollars," Cruz said. "And, the Americans, and for that matter, the legal immigrants who are in Arizona, are seeing unemployment drop, are seeing wages rise. That's who we need to be fighting for."

Arizona is no stranger to controversy with some of its immigration laws. But has the departure of undocumented immigrants after legislation helped Arizona’s economy to the tune of hundreds of millions of dollars?

We decided to fact-check Cruz’s complex immigration claim.

But first, some background on Arizona immigration policy.

Why did immigrants leave?

Arizona’s undocumented immigrant population was on the climb prior to 2007, according to a Pew Research Center study. The population peaked in 2007 with about 500,000 undocumented immigrants in-state.

But from 2007 to 2012, the undocumented immigrant population dropped 40 percent. However, immigrants across the state were already leaving because of the December 2007 recession.

Arizona’s housing market crashed and construction jobs, one of the state’s major sectors, dried up.

Immigrants "have left long before the passage of these anti-immigration laws," said Lisa Magaña, an associate professor in the School of Transborder Studies at Arizona State University.

Arizona passed Proposition 200 in 2004, which requires citizenship to receive social services such as childcare and housing assistance.

The state passed Proposition 300 two years later, which bars in-state tuition for college students without a lawful immigration status.

But the meat of Arizona’s policies toward undocumented immigrants did not start until 2008.

Arizona required employers to use the federal E-Verify system in 2008, which requires an employee to have a Social Security number to legally work.

Finally, then-Gov. Jan Brewer signed SB 1070 into law in April 2010. The measure allowed law enforcement officers with "reasonable suspicion" to ask for a person’s immigration papers when engaging in a stop. Most of the law was struck down by the U.S. Supreme Court, but last September a U.S. District Court Judge upheld the law’s provision that allows police to question the immigration status of those they suspect are undocumented.

Welfare

Welfare has "never gone" to undocumented immigrants, Liz Schott, a senior fellow and welfare expert at the left-leaning Center on Budget and Policy Priorities, said.

However, some children of undocumented immigrants are eligible for benefits if they were born in the United States and are citizens.

Steven Camarota, director of research at the Center for Immigration Studies, which favors reduced immigration, noted that these U.S.-born children could share their cash welfare benefits with their undocumented parents.

In 2008, Arizona spent more than $121 million in cash welfare. In 2014, they spent more than $32 million on cash welfare.

According to Schott, Arizona just spends more in other welfare areas, such as child-care assistance for those working and/or attending school.

"They’re spending it all, they’re just spending it elsewhere," Schott said.

Because it is difficult to determine how many undocumented immigrants receive cash welfare, it’s hard to credit this drop to people leaving the state.

Prisons

As for state prisons, Arizona’s Department of Corrections tracks noncitizens, either documented or undocumented, with a felony conviction.

From fiscal year 2010, which ran from July 2009 to June 2010, to fiscal year 2015, the state’s noncitizen prison population has declined almost 23 percent, but that’s just about 1,400 inmates.

The daily cost of keeping a noncitizen in a state prison hasn’t changed much, either.

In fiscal year 2010, it cost $59.85 per day to house a noncitizen. In fiscal year 2015, it cost $61.55. Because of the dip in noncitizen inmates, that’s a savings of almost $28 million.

However, overall state spending on prisons has increased almost 17 percent between 2008 and 2015.

Elliott Pollack, CEO of his own Scottsdale-based economic consulting firm, said Cruz’s rationale bothers him.

"The cause and effect might be there to some extent, but I just don’t see how it saves hundreds of millions of dollars," Pollack said. "There’s no evidence of that."

Meanwhile, Camarota said the departure of undocumented immigrants "makes things a little better."

"Could he (Cruz) be right? He could be," Camarota said.

However, Cruz’s points are subject to error. Camarota also notes that undocumented immigrants "paid something" in taxes.

A February 2016 report from the left-leaning Institute on Taxation and Economic Policy estimates that Arizona’s undocumented immigrants pay more than $231 million a year in state and local taxes.

Education

On education, the state also does not track spending on undocumented immigrants in schools.

The Wall Street Journal article Cruz described uses the state’s decline in intensive English student enrollment -- about 80,000 students between 2008 and 2012 -- as a potential cost-saving measure, noting that it could save the state about $350 million per year.

But it’s not that simple.

"I think it’s a combination of factors," Arizona Department of Education spokesman Charles Tack said, noting that the decline could be attributed to students leaving the system or being reclassified elsewhere.

Plus, that measure correlates intensive English with undocumented immigrants, which isn’t tracked to begin with.

We reached out to the Cruz campaign for comment but did not hear back.

Our ruling

Cruz said, "spending on welfare, on prisons, and education, all of those have dropped by hundreds of millions of dollars" because of Arizona’s exodus of undocumented immigrants.

That’s far from clear.

While it’s technically possible to receive cash welfare through U.S.-born children, undocumented immigrants do not receive cash welfare directly. And, the state’s prison and education budgets do not solely account for those without papers.

Even then, any potential savings would be hard to calculate. It is not an apples to oranges comparison.

The recession played a significant role in Arizona’s immigrant population decline, too. There’s been no noticeable windfall in the state budget for welfare, education and prisons that we could document.

We rate Cruz’s claim as Mostly False.