A Southwest Airlines flight bound for Chicago landed safely at Oakland International Airport Wednesday morning after suffering from maintenance issues that forced it to circle in the sky for several hours, officials said.

The Chicago-bound Flight 2547 took off from Oakland International Airport at 6 a.m. with 139 passengers on board, but the pilot soon noticed an issue with the landing gear and decided to return to the ground to check on it, according to ABC's San Francisco affiliate KGO-TV.

However, the plane couldn't land immediately and had to burn off fuel before doing so. This lead to the plane mainting a constant altitude in the air while flying in a circular pattern for a few hours over California's Central San Joaquin Valley.

After descending to 375 feet above the ground, the plane flew by the control tower so traffic controllers could visually inspect the landing gear. Shortly afterward, the pilot was cleared for landing and touched back down to the ground around 10:00 a.m, according to NBC Bay Area.

Nearby emergency crews sped to the plane shortly after landing.

Passenger Ashley Stasio of San Francisco, who was on her way to visit her parents in Pittsburgh, Pa., spoke with a local news crew about the incident.

"Everyone was very concerned because we thought we were having engine trouble, then we found out it was the landing gear," Stasio said at the airport, according to SFGate"It was scary."

"We were told to brace ourselves," she said, describing the final moments before reaching the ground.

Finally touching the ground the passengers were able to breathe a sigh of relief with the worst finally behind them.

"Lots of people were clapping and some people were crying," Stasio said.

The plane has since been taken out of service to be inspected, Southwest officials said. Southwest made it a priority to help the passengers reach their destinations as soon as possible, and while some obliged, others, like Stasio, were too frazzled by the recent events and decided to stay on the ground.

"Right now," she said, "I'm going to get a cocktail."