Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A man aboard a United Express flight from Washington, D.C., to Newark, New Jersey, was arrested Thursday after allegedly ramming the cockpit door before attacking a flight attendant who tried to stop him, according to NBC New York.

Matthew Dingley, 28, was aboard the flight, which was about to touch down in Newark, when he got out of his seat and headed for the cockpit door, NBC New York reported.

Matthew Dingley. Port Authority

Mike Egbert, a passenger aboard the flight, told NBC New York that Dingley got out of his seat and sprinted toward the cockpit before banging on the door.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Egbert said a flight attendant, who attempted to intervene, became the focus of Dingley's attack.

"A slight woman, petite, and this guy was clocking her," Egbert told NBC New York.

Download the NBC News app for breaking news and politics

Other passengers stepped in to pull Dingley off of the woman and regain control of the situation in the cabin. Dingley's erratic behavior continued after the plane landed when he charged at police officers, one of whom was injured after falling down the plane's stairs, Port Authority Police told NBC New York.

The officer broke several ribs, Port Authority Police said.

"If he did actually get into that cockpit lord knows what would have happened," Egbert said.

Six officers were injured and the flight attendant was taken to a nearby hospital and later released, according to NBC New York.

In an email to NBC News, CommutAir, which operates United Express, said the flight in question landed without incident and was met by local police to handle to disruptive passenger.

"Our primary concern is always to ensure the safety of all customers and crew and we are cooperating with authorities. We express our gratitude for the quick reaction of our passengers and crew who responded during this incident," the statement reads.

It was not immediately clear what charges Dingley was facing nor was it clear if he had an attorney.