A U.S. baby was born prematurely in Cancun, Mexico, this week, and held as a “medical hostage,” has finally been released so that he can get care back home.

Little Beckham was born three months early Tuesday, while his parents, Michaela Smith and Larry Ralph, were in Mexico for one last vacation before his arrival.

At 28 weeks gestation, Beckham weighed less than two pounds (900 grams) at birth and his parents were anxious to bring him home to the U.S. for preemie care.

But the Mexican hospital where he was born began demanding several fees before they would allow the family to leave. They asked for fees for his delivery, medical care, discharge and medical release forms.

That prompted family members to set up a GoFundMe page to try to raise the tens of thousands of dollars the hospital was demanding, as well as the costs of an air ambulance to airlift the infant home.

“What started off as a US$7,000 bill has jumped up to $37,000 and keeps rising the past 35 hours, with no end in site (sic),” the fundraising page read.

Family members reached out for help from the U.S. consulate in Cancun as well as their local congressman, but say they ran “into obstacles time and time again.”

On Thursday, though, with help from Indiana Rep. Trey Hollingsworth, the Cancun hospital finally agreed to release the baby.

Beckham arrived back to Indiana Thursday night where he was taken to an Indianapolis children’s hospital where he is now receiving care.

“They are in Indiana!!!” the family posted to the GoFundMe page Thursday night. “…Beckham is getting the proper medical care that he deserves! He is doing well, mom & dad are doing well.”

The family told CNN they spent at least US$50,000 on an air ambulance and the hospital fees but say it was worth the costs to bring their child home.

The U.S. Embassy and Consulates in Mexico website warns that while hospitals and clinics in major cities in Mexico offer good-quality care, they expect payment in advance.

The Canadian government offers a Mexico travel advisory that warns of the same thing, noting Mexican hospital fees are generally expensive.

“Many (hospitals) will not agree to deal directly with medical insurance companies. Be prepared to pay for treatment yourself and then request a refund from your insurer,” the agency warns.

It also advises travellers to ensure they have “adequate travel health insurance and accessible funds to cover the cost of any medical treatment and medical evacuation.”