A man attempted to storm an airliner’s cockpit while the plane was in flight, injuring a flight attendant, then fought with several police officers while being taken into custody after the plane landed in New Jersey, police said. Six officers were also reported hurt in the incident.

Matthew Dingley, 28, was on a flight bound for Newark Liberty International Airport on Thursday night when passengers witnessed him becoming violent and erratic, NBC New York reported. They watched as he rose from his seat and ran toward the cockpit.

“This guy was in a full sprint, right up to the cockpit, hits the cockpit, starts banging on it,” passenger Mike Egbert told NBC. He and others on the United Express flight from Dulles International Airport watched as Dingley assaulted a female flight attendant who tried to stop him.

Several passengers then intervened, NBC New York reported.

Once the plane had landed at Newark, Port Authority police attempted to board the aircraft and encountered a belligerent Dingley. He allegedly charged at the officers, Port Authority police spokesperson Lenis Rodrigues told The Washington Post, causing them to fall down a set of stairs used to disembark passengers and hit the pavement. One officer broke four ribs.

One police officer was hospitalized after he fell off the stairway. A total of six officers suffered injuries during the arrest and were transported to a hospital, according to Rodrigues. The flight attendant was also taken to the hospital.

After backup officers arrived, Dingley was arrested and charged with criminal trespassing, resisting arrest and aggravated assault. He is being held at the Essex County, New Jersey, Correctional Facility. Police did not immediately provide a suspected motive for why Dingley allegedly charged the cockpit.

“If he did actually get into that cockpit,” Egbert told NBC, “lord knows what would have happened.”