Passengers on board United Airlines Flight 179 from New Jersey's Newark Liberty International Airport to Hong Kong International Airport were faced with multiple travel nightmares this weekend. First there was a medical emergency that prompted an unplanned landing at a military base in Canada late Saturday; then passengers couldn't leave the plane after it was on the ground, according to a statement from United.

Flight 179 was diverted to Goose Bay Airport, a military base in Canada's Newfoundland, where "medical personnel met the aircraft at the gate and the customer was transported to a local hospital," United said in a statement Sunday.

Because the plane landed so late at night, there were no customs personnel available. The passengers had to spend the night in the plane for more than a dozen hours. The cabin had heat and power while it was on the tarmac. United said in a statement they had sent a relief aircraft to transport customers back to Newark.

Get Breaking News Delivered to Your Inbox

Some passengers on the jet tweeted pictures of the incident and reported that a cabin door broke "on the ground" at the military base, possibly because of the frigid temperatures there, well below zero.

United #UA179 Newark to Hong Kong diverted to Goose Bay for a passenger medical emergency last night. Once on the ground a door broke. Not able to depart. After ~15 hours on the plane, passengers now transferring to rescue flight which will take them back to Newark. pic.twitter.com/E6dVFr43yZ — Tom Podolec Aviation (@TomPodolec) January 20, 2019

United apologized to its customers, saying "our crew is doing everything possible to assist them during the delay."

Passengers have returned to Newark late Sunday, according to CBS New York.

Magid, who lives in Alpine, New Jersey, spoke with the station: "The staff, the crew was amazing. I feel bad for them, because they had no information."

"Clearly the pilots didn't really know what was going on. They weren't given a clear message, either, so it certainly wasn't their fault," passenger Alex Forshay told CBS New York.

A graphic provided by FlightAware shows United Airlines Flight 179 turning around and landing at Goose Bay in Canada. FlightAware

CBS New York reports United Airlines rebooked many of the passengers and reimbursed others for the inconvenience. The station also said all passengers on board were given a full refund, an additional $500 credit, a $100 gift card and vouchers for food and a hotel stay.

This wasn't the first time a United plane had to be diverted to Canada.

In 2015, a flight from Chicago to London was diverted there. Passengers had to spend a night in a cold Canadian military barracks. There was backlash over that incident because the 11 crew members apparently spent the night in a nearby hotel.

Kris Van Cleave contributed to this report.