Immigration officials deported the spouse of a U.S. soldier killed in Afghanistan last week, leaving the couple's 12-year-daughter in Phoenix, then abruptly reversed its decision on Monday when the deported man was allowed to return to the U.S.

Jose Gonzalez Carranza, 30, was arrested by Immigration and Customs Enforcement officers last Monday on his way to his welding job and then deported to Nogales, Sonora, early Thursday, according to Gonzalez Carranza and his attorney, Ezequiel Hernandez.

Gonzalez Carranza was married to Army Pfc. Barbara Vieyra, who was killed on Sept. 18, 2010, while serving in the U.S. Army in Afghanistan. She was 22.

During an interview, Gonzalez Carranza told The Arizona Republic that he was allowed to re-enter the U.S. through the DeConcini port of entry in Nogales, Arizona, on Monday afternoon.

He said he was then driven back to Phoenix, where ICE officials dropped him off at the agency's headquarters near downtown.

ICE:U.S.-born Marine was nearly deported by ICE, and his mom wants to know why

Immigrant dad deported:Deported after 30 years in US, father still stuck in Mexico one year later, without wife and kids

ICE officials offered no explanation for the decision to allow Gonzalez Carranza to return to the U.S. But Hernandez believes the reversal was triggered by media attention the deportation received.

Deferred Enforced Departure:Hundreds of Liberians legally in U.S. face deportation following Trump decision

Want news from USA TODAY on WhatsApp? Click this link on your mobile device to get started

Gonzalez Carranza said he was eager to see his daughter, who lives with her grandparents.

He said he had not told her that he had been deported because he was afraid she would be further traumatized after the loss of her mother.

Reached by phone earlier Monday in Nogales, Gonzalez Carranza said he had been living in a shelter for deported migrants in Nogales, Mexico, a city he didn't know, and was worried about his daughter, Evelyn Gonzalez Vieyra, a U.S. citizen.

"I feel so bad," Gonzalez Carranza said. "I'm thinking about, I might never see her again."

Hernandez said it seemed cruel for ICE to inflict additional pain on the man and his daughter, noting the trauma they experienced after the death of his spouse.

"There are plenty of people you can go after but not a guy whose wife died in Afghanistan," he said.

Vieyra was mortally wounded when insurgents attacked her unit using an improvised explosive device and rocket-propelled grenade fire in Kunar Province, Afghanistan, the Pentagon said at the time. Her unit had been sent to Afghanistan as part of Operation Enduring Freedom.

Migrant deaths:Fourth person in six months dies in ICE immigration detention center

Las Cruces seeks aid:New Mexico city asks for donations as Border Patrol drops off migrants for the first time

Cecillia Wang, deputy legal director at the ACLU, said she could not recall a similar deportation. She said the deportation was unnecessary.

“It’s the height of cruelty for ICE to deport the father of a child whose mother died while serving in the U.S. army in Afghanistan," Wang said. "The government can exercise its discretion not to pursue deportation against the sole remaining parent of a U.S. citizen child under these circumstances."

Gonzalez Carranza said he came to the U.S. illegally from Veracruz, Mexico, in 2004, when he was a teenager. He said he and Vieyra married in 2007.

After his wife was killed in Afghanistan, Gonzalez Carranza was granted what is known as parole in place, which allows immigrants in the country illegally to remain in the U.S. without the threat of deportation, Hernandez said.

An immigration judge then terminated deportation proceedings against Gonzalez Carranza based on the parole in place, Hernandez said.

However, ICE refiled the case in 2018, Hernandez said.

A judge ordered Gonzalez Carranza deported in December after Hernandez didn't show up for his court hearing, Hernandez said.

But the reason Gonzalez Carranza didn't show up is because he never received the notice, Hernandez said. He said ICE sent it to the wrong address.

Trump on immigration:President’s advisors tell him to charge ahead on immigration, even as courts shut him down

'A new level of inhumanity':Democrats denounce White House idea to release migrants in sanctuary cities

Gonzalez Carranza didn't find out a judge had ordered him deported until ICE officers came to his house last Monday and took him into custody, Hernandez said.

Hernandez said he filed a motion to reopen Gonzalez Carranza's deportation case. The motion triggered an automatic stay of removal, but ICE deported him anyway, Hernandez said.

Wang also said Gonzalez Carranza should not have been deported if there was a stay of removal. She said, however, it is "not uncommon" for ICE to violate stays of removal.

On Monday, Hernandez sent out a news release to draw attention to Gonzalez Carranza's case.

Hernandez said he can't understand why ICE deported him. Gonzalez Carranza has no criminal record, he said.

"This guy's wife died in action in Afghanistan," he said.

After speaking to The Arizona Republic, Hernandez said he received a call from an ICE officer who told him the agency was making arrangements to allow Gonzalez Carranza back into the United States.

Reports:Trump offered to pardon Homeland Security head if law broken while closing border

Opinion:Democrats should support Donald Trump's border wall. It's a mistake for them to fight it.

Shortly after, Gonzalez Carranza was handcuffed at the border crossing in Nogales by Customs and Border Protection officers and allowed into the U.S., Hernandez said. He was then transported to CBP offices in Tucson, he said.

ICE officials then told Hernandez that Gonzalez Carranza would be transported to Phoenix that night and then released on his own recognizance, Hernandez said.

ICE officials did not immediately provide information on the case, but a spokeswoman for Sen. Kyrsten Sinema, D-Ariz., said Sinema's office had reached out to help.

“Our office is in communication with Mr. Carranza’s attorney and we will assist the Carranza family in this process," Sinema spokeswoman Hannah Hurley said in an email.

Rep. Ann Kirkpatrick, D-Ariz., decried the "un-American" immigration and border actions taken under President Donald Trump.

Family tried to keep memory alive

Barbara Vieyra’s sister, Guadalupe, said Gonzalez Carranza sees his daughter occasionally on weekends.

Vieyra did not know Gonzalez Carranza had been deported until a reporter knocked on her door Monday night. She called her parents, who said they did not learn of the situation until Monday morning.

Guadalupe is one year younger than her sister and said her family does the best they can to keep Barbara’s memory alive for Evelyn.

“When she was 3, she was too young to know what happened, but now she’s almost a teenager,” she said. “We talk about it all the time. We celebrate my sister’s birthday and the anniversary of her death because we want my niece to know her mother died fighting for her country.”

Republic reporters John D'Anna, Yvonne Wingett Sanchez and Ronald J. Hansen contributed to this story.

Follow Daniel Gonzalez on Twitter @azdangonzalez.