They were escorted off a grounded plane after being accused of acting "unruly."
VIDEO: Aeromexico flight stuck on Oakland Airport tarmac for hours
It all started when Aeromexico flight 662 from Guadalajara, Mexico was supposed to land at San Francisco International Airport (SFO) at 10:40 a.m., but was diverted to Oakland because of the fog, officials said.
Around 2 p.m., the plane was still on the tarmac in Oakland - with passengers still on-board.
After being grounded for more than three hours, passengers started getting restless, and complained about the air conditioning and sitting there for so long, Sgt. Ray Kelly said.
ACSO contacted an upset passenger @IFlyOAKland on an Intl AeroMexico flight that was destined for SFO but was diverted to OAK for fog. The passenger was upset and wanted off the plane. Deputies responded to plane and have contacted passenger. Working to deplane everyone with CBP— Alameda County Sheriff (@ACSOSheriffs) January 10, 2019
One man became upset and threatened to open the aircraft door and exit. Crews were concerned that it would activate emergency ramp system on an active tarmac, Kelly said.
This is when Alameda County Sheriff's Office was called, and got special permission from U.S. Customs to board the plane.
VIDEO: Here's a look at the fog that caused this flight to be diverted in the first place
Deputies boarded the aircraft and confronted the man who threatened to open the door. They detained him and another passenger, who was also upset, according to Kelly.
The two people who were detained were released after speaking with authorities.
The two “Unruly” passengers have been released after speaking with authorities. https://t.co/Og3I17Yqo7— Alameda County Sheriff (@ACSOSheriffs) January 11, 2019
SKY7 was overhead and spotted one person being escorted from the plane in handcuffs.
Another person requested medical assistance for breathing difficulty, sheriff's officials said.
The paramedics were called out of caution, and that person was transported away on a gurney and given oxygen.
RELATED: Passengers stuck on plane for nearly 28 hours land at SFO
Sheriffs worked with the airline and customs to get everyone out of the gate.
A passenger told ABC7 News that they were given very little information, but were told the diversion happened due to "bad weather conditions" and that the SFO airport was closed.
The conditions on the plane were "suffocating," he added.
The passenger also told ABC7 News that officials told them they could not get off the plane in Oakland due to "international regulations" and that they had to wait in the plane until the weather cleared at SFO.
VIDEO: Woman wrestled to ground after allegedly trying to open cabin door on SFO flight
After that the passenger said things escalated, with passengers getting angry and threatening to get off the plane themselves.
The passenger said that some passengers had some medical issues but that nothing appeared to be life-threatening.
Eventually, the flight was deplaned and passengers went through customs at Oakland Airport.
Those who still needed to get to SFO were provided a bus shuttle.