Follow CBSMIAMI.COM: Facebook | Twitter

MIAMI (CBSMiami) – There’s a happy ending in the saga of a South Florida man imprisoned in the Middle East over a misunderstanding.

READ MORE: Closing Arguments Wrap In Dayonte Resiles Murder Trial

Coconut Grove resident Matthew Gonzalez was imprisoned in Abu Dhabi for the last nine weeks over his prescription pain medication.

His family wanted him home by this weekend so he could attend his mother’s funeral.

Gonzalez’s loved ones announced Thursday night he is free and on his way back to the United States.

“My uncle got released… my family is happy, I’m happy,” said 17-year-old Sebastian Mallens. “We are going to see him tomorrow or the next day.”

Mallens spoke to CBS4’s Vanessa Borge from Wisconsin, where his family is attending the funeral.

Gonzalez’s mother passed away while he was detained overseas.

READ MORE: New NASA Mission Will Test Lasers As A To Communicate With Future Missions

Gonzalez, who works in information technology, was detained in Abu Dhabi because he didn’t have a prescription in hand for his pain meds.

His sister, Nicole Denil, told us she’s travelled to Abu Dhabi several times providing the documents that showed Gonzalez had a valid prescription, but he was still sentenced to two years in prison.

“The worst part is he was declared innocent by the judge of all the charges related to having the drug, and now he is sentenced because he didn’t register it,” Denil said prior to his release.

His family contacted politicians hoping they could help bring Matty home.

Congresswoman Ileana Ros-Lehtinen even commented on his case.

“I’m contacting the ambassador in Washington. I don’t know the full story but it is troubling to be detained in this way,” she said. “It’s very troubling that they would hold an American in this way.”

But after nine weeks – all the anguish and uncertainty behind them – Matty’s family ready to see him again.

MORE NEWS: Florida House Leaders Push Back On Redistricting Criticism

“It’s amazing, it’s truly a miracle. My family and I, we are excited and happy. We can’t wait to see him,” Mallens said.