The couple had travelled from Houston to the Louisiana base to obtain a military ID for Ramos and activate her military spouse benefits, with plans to move her onto the base over Easter weekend.

Instead, Blank said, she was “ripped away” from him last week.

During an appointment at the base, the couple presented Ramos’s birth certificate, Honduran passport, their marriage license and Blank’s military identification.

“I never imagined that trying to do the right thing would lead to her being taken away from me,” Blank earlier told the BBC. “What was supposed to be the happiest week of our lives has turned into one of the hardest.”

Ramos was placed in handcuffs by Immigration and Customs Enforcement (ICE) agents before being driven away in a military vehicle.

“Being in detention is a choice,” the agency said in a statement.

“We encourage all illegal aliens to take control of their departure with the CBP Home App,” it said, noting that the US was offering money and a free flight to those who self deport.

As family members frantically tried to contact immigration officials to ensure that Ramos was not deported, Senator Mark Kelly of Arizona, where the sergeant’s family is from, contacted Blank to tell him he would push for Ramos’ release.

A spokeswoman for the senator said Kelly also spoke to Homeland Security Secretary Markwayne Mullin, who was already aware of the case.

“I’m happy Annie is back with her husband and family where she belongs,” Senator Kelly told the BBC after Ramos’s release. “They never should have gone through this painful process, but far too many families like theirs are because of this administration.”