A teenage passenger was taken to a hospital for mental health treatment after he opened an emergency door on an airplane minutes after it landed in San Francisco then slid down the wing to the tarmac, officials said Wednesday.

The teen traveling on Copa Airlines Flight 208 from Panama City was not injured during Tuesday's incident at San Francisco International Airport, airport spokesman Doug Yakel said.

The 17-year-old — a U.S. citizen — was traveling alone and appeared to be in emotional distress during the flight, Yakel said. The teen's name has not been released.

City police Officer Grace Gatpandan said Wednesday he was taken for treatment and will not be charged by local authorities.

However, Copa Airlines said it is a violation of federal law to open an emergency door without having been instructed to do so by the crew.

Federal prosecutors in San Francisco did not immediately respond to a message seeking comment.

After jumping from the plane, the teenager was held by an airfield construction crew until police arrived and arrested him.

Witnesses said the teen seemed fidgety and anxious throughout the seven-hour flight. He was already on the ground and running by the time passengers realized the door had been opened.

"It was as if he was like flying out, like it was really fast," passenger Sophia Gibson told San Jose television station KNTV.

Emergency exits over wings are intended to be opened by passengers at lower altitudes to allow evacuations in emergencies, the airline said.

Copa confirmed in an email to The Associated Press that the boy was sitting in an exit row during the flight and that personnel had followed Federal Aviation Administration rules requiring passengers seated in an exit row to be at least 15.

Flight attendants also followed security and safety procedures after the teenage pushed open the door, the Panama-based airline said.

A crew member closed the door and the plane proceeded to a gate where passengers and crew safely left the aircraft, it added.

Passenger Matt Crowder said people sitting near the exit row stood up and shouted when the boy jumped.

"They were yelling, 'Tell the flight attendants. Relay the message back. The door's open. Someone jumped off,'" Crowder told the television station. "It was pretty crazy."

Passenger Isaac Rodrigues said a flight attendant used her body to block the gap where the door had been.

"We were on the runway for about an hour," Rodrigues said.

No other flights were affected, Yakel said.