A man aboard a United Express flight from Washington, D.C., to Newark, New Jersey, was arrested over the weekend 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.

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.

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.

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.

CommutAir, which operates United Express, did not immediately return a request for comment made by NBC News.

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