An Air Canada flight headed for Shanghai was forced to make an emergency landing shortly after taking off from Trudeau airport on Saturday.

Passengers onboard flight AC017 reported hearing unusual sounds as the plane pulled away from the tarmac.

"Already a few moments after take off, we knew something wasn't working right," said Josh Jacobs, a Boston resident who was on the flight.

"But the captain intervened quickly and made an announcement, which avoided panic."

Officials with the airline said a warning light came on in the cockpit of the Boeing 787. The crew, following emergency procedures, shut down the engine, dumped fuel and contacted emergency teams on the ground.

Jacobs captured an image of the fuel dump on his phone.

Glad 2b back <a href="https://twitter.com/aeroportsMTL">@aeroportsMTL</a> <a href="https://twitter.com/AirCanada">@AirCanada</a> <a href="https://twitter.com/hashtag/AC17?src=hash">#AC17</a> YUL-PVG engine fail on takeoff. Engine shutdown, fuel dump: professional response <a href="https://twitter.com/globeandmail">@globeandmail</a> <a href="https://t.co/oo4VKAPhtC">pic.twitter.com/oo4VKAPhtC</a> —@josh_edu

The emergency landing was executed without incident, the airline said. ​

"Our technical team will proceed with an inspection of the engine to determine the cause of the incident," said Isabelle Arthur, a spokesperson for Air Canada.

There were 213 passengers onboard the flight. Air Canada arranged for them to continue to Shanghai on Saturday evening.