OAKLAND, Calif. -- Two people who were detained Thursday at the Oakland International Airport have since been released.
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.
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.
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.