United Airlines apologized on Tuesday after a dog died on a flight during which it was stored in a passenger’s overhead compartment. A witness said that a flight attendant had ordered the pet owner to put the dog in the compartment before the plane took off.

The dog, a black French bulldog that was traveling in a pet carrier, was placed in the compartment shortly before United Flight 1284 left Houston for New York at around 6 p.m. Monday, said Maggie Gremminger, 30, who was seated behind the pet owner. She said the owner was instructed to put her dog there shortly after she boarded with two children, one of whom was an infant.

“The pet owner was very adamant that she did not want to put the pet carrier up above,” Ms. Gremminger said. “She was saying verbally, ‘My dog is in here, no, this is my dog.’ The flight attendant, in response, really just continued to ask her to put it above because it was a hazard where it was, it was a safety emergency, someone could trip.”

Eventually, the pet owner, whom United declined to name, complied with the flight attendant. Ms. Gremminger said the owner was preoccupied by her infant during the flight and did not check on the pet, which fell eerily silent after barking during takeoff and as the plane ascended to its cruising altitude.