A former U.S. Marine freed after spending seven months in a Mexican prison on a gun charge is back in the United States.

The State Department said it was pleased that Mexican judicial authorities had ordered the release of Sergeant Andrew Tahmooressi, who then returned to his family's home in Florida. State Department spokeswoman Jen Psaki said Saturday that U.S. officials were grateful for the cooperation from Mexico, which allowed Tahmooressi prompt and continued consular access and visitations.

Doctors said Tahmooressi suffers from post-traumatic stress disorder, which he developed after serving with the Marines in Afghanistan.

Mexican border agents arrested Tahmooressi in March when they found three guns in his truck after he crossed the border from San Diego, California, into Tijuana.

Tahmooressi said he crossed into Mexico accidentally after getting stuck on a California freeway with no way to turn back from the border. Mexican police, however, said he entered the country deliberately.