Two passengers on an Aeromexico jet were arrested and later released after becoming upset when their plane sat on the tarmac at Oakland International Airport for hours — with no air conditioning, authorities said Thursday.

The Aeromexico flight from Guadalajara —originally destined for San Francisco International Airport — was diverted to the Oakland International Airport due to foggy conditions at 10:30 a.m. and sat on the tarmac for more than three hours, said Sgt. Ray Kelly, a spokesman for the Alameda County Sheriff’s Office.

Sheriff’s deputies responded to the airport after the Aeromexico pilot called police to report an “upset passenger” who “wanted off the plane” and threatened to open the aircraft doors to leave, Kelly said during a press conference in an airport parking lot.

“If the door was to be opened it would activate the airplane’s emergency ramp system on an active tarmac, which would further cause concerns for safety and aircraft safety,” Kelly said. “Was the man really going to open the door? Probably not, but he voiced his intent to do so and the pilot did the right thing to call law enforcement.”

Authorities received an unknown number of 911 calls from frantic passengers saying they felt as if they were being held against their will on the aircraft, Kelly said. Other passengers took to social media and called local news organizations to complain of the hours-long wait in cooped quarters and no air conditioning pumping throughout the plane.

Passengers interviewed by KTVU reporters said they were not given water, food or provided any information from flight attendants on board, stating crew members instead hid behind curtains during the hours-long wait.

Sheriff’s officials had to get special clearance from U.S. Customs and Border Protection before boarding the international flight, he said, as there are regulations for boarding international flights.

When deputies finally boarded the plane, authorities arrested a second passenger who was upset.

Both male passengers, whose names were not immediately released, were initially detained for “interfering with a flight crew or an aircraft,” but were later released after authorities determined “they should not be arrested at this time,” sheriff’s officials said on Twitter Thursday night.

Before the pair was released, Kelly said the Federal Bureau of Investigation would investigate the pair for “interfering with a flight crew or an aircraft.” It is unclear if federal officials will continue to investigate the incident.

“It should be noted through that the passenger bill of rights does not apply to international flights,” he said. “When that aircraft is coming from a foreign country, and has not been cleared by customs, there are certain laws that need to be followed verses a domestic flight.”

Update: a second upset passenger was also detained upon entry. 1 person requested medical assistance for breathing difficulty. Working with airline and customs to get everyone of at gate. Updates to follow https://t.co/rl2Th8WCiz — Alameda County Sheriff (@ACSOSheriffs) January 10, 2019

Officials with Aeromexico or with the Oakland International Airport could not be reached for comment on Thursday afternoon.

Kelly said the airline could have allowed passengers off — but for some reason chose not to.

“The decision to not deplane lies solely on the commercial airline,” Kelly said. “Why that airplane chose not to do that, we’ll ask later, but that obviously led to several hours of them being on the tarmac and passengers being upset.”

The two “Unruly” passengers have been released after speaking with authorities. https://t.co/Og3I17Yqo7 — Alameda County Sheriff (@ACSOSheriffs) January 11, 2019

One woman told deputies she had trouble breathing in the plane and asked for medical assistance, officials said. Paramedics provided the woman oxygen and took her to a local hospital, Kelly said.

Deputies worked with U.S. Customs and Border Protection officials to deplane the aircraft at Gate 1 of the Oakland airport, where passengers passed through customs sometime after 2 p.m., officials said.

Passengers had the option to fly out of Oakland to get to their final destination or use alternative transportation to San Francisco provided by Aeromexico, Kelly said.

Lauren Hernandez is a San Francisco Chronicle staff writer. Email: lauren.hernandez@sfchronicle.com Twitter: @LaurenPorFavor