A US soldier's wife who was detained by immigration agents at the military base where he is stationed - just days after their wedding - has been released.

Annie Ramos, 22, an undocumented immigrant who came to the US as a toddler, was arrested on April 2 and spent five days at a detention centre alongside hundreds facing deportation under the Trump administration's immigration crackdown.

Immigration officials described Ramos as an illegal alien from Honduras who was arrested after attempting to enter a military base.

I feel awesome. Relieved. Relieved, Staff Sergeant Matthew Blank told the New York Times after his wife's release. These have been the worst days of my life.

I can't wait to carry my wife into our home and start our lives together, Blank shared with the newspaper, expressing his relief and commitment. I'm complete and ready to serve our country. And it's her country, too.

Blank, who enlisted more than five years ago and has served in the Middle East and Europe, is set to begin training later this month ahead of another deployment.

Ramos, a biochemistry student, looks forward to finishing her studies and building a life with her husband. All I have ever wanted is to live with dignity in the country I have called home since I was a baby, she stated.

The Department of Homeland Security has mentioned Ramos's lack of legal status, and despite the distressing circumstances, they did not answer follow-up questions regarding her case.

Blank and Ramos had traveled from Houston to the Louisiana base to obtain a military ID for her and activate her military spouse benefits, with plans to begin their life together during Easter. Instead, Blank described how she was ripped away from him during this critical time.

During the appointment at the base, they had all required documentation, yet Ramos was handcuffed by ICE agents and taken away. The agency stated that being in detention was a choice, and encouraged undocumented migrants to self-deport.

As support for their case grew, Arizona Senator Mark Kelly contacted Blank, vowing to advocate for Ramos's release. Senator Kelly affirmed after her release, I'm happy Annie is back with her husband and family where she belongs. They never should have gone through this painful process, but far too many families like theirs are because of this administration.

The case has drawn substantial criticism, highlighting a shift away from past leniencies historically shown to military families by immigration enforcement. Advocates argue that the incident compromises military morale and conflicts with national values.

Gaby Pacheco, president of TheDream.US, articulated the larger implications of this kind of detention, calling it a wake-up call for the nation and emphasizing the need to support military families rather than weaken them.