Japan Airlines canceled a flight last week from Dallas to Tokyo after its captain got drunk at a hotel in the U.S. city and was warned by local police.

The flight was scheduled to depart at 11:05 a.m. Wednesday with 157 passengers. Many of the passengers were transferred to an American Airlines flight.

According to JAL, the 49-year-old male captain arrived in Dallas on Monday morning.

He drank alcohol with other crew members at a restaurant from around 6 p.m. on the same day and continued drinking after returning to the hotel.

The hotel warned him about the noise, and he stopped drinking. But the hotel called police at around 2 a.m. Tuesday due to his shouting.

The captain did not violate JAL's regulations against drinking alcohol within 12 hours of boarding. But the company decided to cancel the flight because it had to check the physical and mental conditions of the captain and needed time to arrange a replacement.

The captain was quoted as saying that he did not notice he was drunk.

In a statement, JAL apologized for the inconvenience caused by the crew member's inappropriate behavior.