A United Airlines flight headed to Houston this week was forced to make a "frightening" emergency landing after one of its engines overheated.

Flight 1516 left Liberia, Costa Rica, shortly after noon Monday with 165 passengers aboard.

The twin-engine Boeing 737 had a "maintenance issue" during the flight and returned to Daniel Oduber Quirós International Airport after circling to burn fuel, airline spokeswoman Erin Benson said. Fire crews awaited the plane, which was over its normal landing weight, she said.

One of my plane's engines overheated over the ocean. We about crashed in an emergency landing before the pilot quickly pulled up. So scary. pic.twitter.com/qbmlQOnYRX — Jody Genessy (@DJJazzyJody) April 24, 2017

Jody Genessy, a basketball reporter for Utah's Deseret News, was aboard the flight and tweeted that the emergency landing was "the most frightening thing I've ever experienced."

United has been under fire in recent weeks — notably for an incident where a man was violently dragged off a plane — but Genessy said the pilot did an amazing job landing the plane with just one engine.

When the plane was just about to touch down, Genessy said, wind hit the plane and nearly caused one of the wings to hit the tarmac. The pilot was able to pull up just in time, he said.

"United is getting a lot of grief right now, and I'm a Delta guy, but my hat's off to the pilot," Genessy told NBC News. "As far as I'm concerned, he saved our lives."

Passengers were given compensation Monday and rebooked on a flight to Houston on Tuesday, Benson said.

Genessy tweeted that the new flight had the same pilots and crew as Monday's flight and that passengers in the airport terminal gave them a standing ovation.

We have the same pilots and crew for our United flight today. They got a loud standing ovation from us in the terminal. Different plane. pic.twitter.com/c7sRqJnqOz — Jody Genessy (@DJJazzyJody) April 25, 2017

The Associated Press contributed to this report.