A United Airlines Boeing 747 departing San Francisco has landed safely after declaring an emergency on takeoff Monday afternoon. The flight circled off the Pacific coast shortly after takeoff to dump fuel before returning to the airport.

The flight, Flight 837, was bound for Tokyo Narita Airport when it encountered the problem.

According to reports from San Francisco station KNTV, a loud bang was heard and flames were seen coming from the engine of the jet as it took off from San Francisco International Airport.

The plane had to shut down one of its engines, and was returning to the airport.

"Just saw fire come out of an engine of a plane taking off from SFO," according to a tweet from Sam Smith. Smith was in his office in San Bruno, and said the 747 had flames coming out of the left side of the engine, and that there was a loud bang.

After the plane circled to dump fuel and lighten its load, it landed without incident at San Francisco International Airport.