Mechanical issues forced a Brazil-bound United Airlines flight to turn around and make an emergency landing Thursday at Newark Liberty International Airport in New Jersey.

An initial maintenance inspection noted that there may have been an issue with a hydraulic pump, United Airlines said in a statement. A Boeing 777 has three of these pumps and can still operate with only one working.

Sparks and debris reportedly flew off the plane as it ascended from takeoff.

The aircraft stayed in the air for two hours, and circled around the Atlantic Ocean, before returning to Newark. There were 256 passengers aboard the Boeing 777 aircraft, which was headed to Sao Paulo.

"After our aircraft experienced a mechanical issue shortly after takeoff, it remained in the air to burn fuel and then landed safely," United said in a statement.

United confirmed that a new plane was sent to get passengers to their destination which was scheduled to leave Thursday morning.

"Passengers deplaned at the gate and a new aircraft is scheduled to depart this morning," United added.

The Federal Aviation Administration has initiated an investigation into the incident.