A United Airlines flight had to make an emergency landing in Alaska because a passenger tried to commit suicide in the plane bathroom, the airline said Thursday.

United Airlines flight UA851 from Chicago to Beijing was diverted on Wednesday and landed in Anchorage "because of a medical emergency." The medical emergency was a female passenger that was found trying to hang themselves in the lavatory of the flight. The flight had to land in Alaska so the passenger could be taken to a local hospital, Shanghaiist reports.

Since the flight was unexpectedly diverted, the other passengers were put up in hotels overnight. They were placed on other flights to China on Thursday.

The Beijing News found several passengers that were on the flight on China's social media site Sina Weibo, commenting about what had occurred.

"You won't believe it, the UA851 flight we are on had to turn back and do an emergency landing in Alaska because someone tried to hang themselves in a toilet," said one passenger.

"Unbelievable, we were flying UA851 over the North Pole when there was an emergency, economy class passenger hanged herself in the bathroom but was rescued, we were returned to Alaska for emergency landing" @想要拥有姜Gary wrote on Weibo.

Another passenger said that the passenger who tried to kill herself was an Asian woman in her 40's.

"It was a woman in her 40s and of Asian heritage," the passenger said. "A bit later, I heard that the crew were looking for a doctor, and then the plane landed in Alaska to save her."

"A few points to clarify: First, I wasn't sure whether the woman attempted suicide although my seat was near the toilet. I didn't know something went wrong before the cabin crew called for doctors. She did seem abnormal though. When we landed, she was taken off the plane while constantly shouting," another passenger recalled.

United Airlines confirmed that the flight was diverted due to a suicide attempt, but would not comment further on the incident.