A Mexican court has ordered a former U.S. Marine jailed for bringing guns into the country freed from prison.
Andrew Tahmooressi had been behind bars since March.
The former sergeant from Florida boarded a plane for home late Friday, and a U.S. State Department spokeswoman said Saturday that Tahmooressi was back in the United States.
A doctor who examined him earlier determined he needed treatment in the U.S. for post-traumatic stress syndrome, which he developed after serving in Afghanistan.
Mexican border agents arrested him in March after finding three guns in his truck. He had crossed the border from San Diego, California, into Tijuana.
Tahmooressi said he crossed into Mexico accidentally after getting caught on a California freeway with no way to turn back from the border.
Mexican police said he entered the country deliberately.
Bringing guns into Mexico is a federal offense.
State Department spokeswoman Jen Psaki said in a statement Saturday that throughout Tahmooressi's incarceration, the department "followed his case very closely, communicating with him and family members constantly and facilitating many visits by U.S. officials, members of Congress and family members."
The efforts of Tahmooressi's family, attorneys and supporters allowed him to receive required medical care, she said, expressing gratitude to Mexican authorities for providing "prompt and continued consular access, visitations and regular accommodation of multiple requests made by the U.S. government and defense team on behalf of Mr. Tahmooressi."