Discuss as:

Former Marine held in Mexican jail freed, officials say

View more videos at: http://nbcmiami.com.

Updated 10:30 p.m. ET: The South Florida Marine veteran who for months was detained at a Mexican prison for bringing an unloaded shotgun into the country has been freed, officials and his lawyer said late Friday.

Jon Hammar is seen in an undated photograph provided by his family.

The attorney for Jon Hammar tweeted Friday night that his client had been released from a detention center in Matamoros, Mexico. U.S. officials were planning to drive the 27-year-old Hammar across the border at Brownsville, Texas.

"He's out. Going home," wrote Eddie Varon Levy in a tweet.

With the judge’s ruling, Hammer was expected to be released after noon Friday, according to a statement from U.S. Rep. Ileana Ros-Lehtinen.

Several members of Congress said earlier Friday that a judge had agreed to free Hammar.

U.S. Sen. Bill Nelson's office said in a statement that according to a defense attorney, 27-year-old Jon Hammar was being held at the Matamoros prison on a gun charge, but at a hearing, it was determined he had no intent to commit a crime by taking the firearm to Mexico.

"No American should be in a Mexican jail for five months without being able to have his case in front of a judge," Nelson said Friday. "We're grateful; this is a good Christmas present."

With the judge’s ruling, Hammar was expected to be released after noon Friday, according to U.S. Rep. Ileana Ros-Lehtinen.

NBCMiami.com: Family steps up lobby to get Hammar released

“Our Marine hero, our local hero, will be freed today from a Mexican prison,” Ros-Lehtinen said at a press conference. “He’s been there chained to his bed in terrible condition since August for a trumped-up gun charge that should have never been leveled against him.”

The Marine veteran’s mother notified congressional members of her son’s pending release early Friday. The news was confirmed by a defense lawyer, the State Department and the Mexican embassy, according to spokespeople for Nelson and Ros-Lehtinen.

His mother, Olivia Hammar, called Ros-Lehtinen’s office to say, “Hallelujah! Prayers work and hard work pays off,” Ros-Lehtinen said.

Friday, the U.S. Consulate was standing by to safely escort the former Marine to the United States. Instead of being taken on a plane, Hammar was to be driven across the Mexican border to Texas.

Ros-Lehtinen said the Hammar family is thankful for the community’s support. “He will be home for Christmas,” Ros-Lehtinen said. “The family has been so grateful.”

At his home in Palmetto Bay, Hammar's mother anxiously waited until she was assured he was safe and in the U.S.