Harrison Ford almost died on the sets on “Star Wars: The Force Awakens” when aboard the Millennium Falcon, a film production company admitted in court Tuesday.

The 74-year-old actor, famous for his portrayal of Han Solo in the 'Star Wars' original trilogy, was knocked to the ground in June 2014 while shooting for the recent film in the Star Wars franchise at London’s Pinewood Studios. He was crushed beneath the heavy door of the Millennium Falcon spaceship. Ford reportedly sustained severe injuries from the accident, including a broken left leg.

The film production company, Foodles Production, responsible for the accident pleaded guilty to two breaches under health and safety law. The company owned by Walt Disney Co. will be sentenced next month, reports said. But, the company’s lawyer Angus Withington said Foodles will contest the level of risk involved.

Prosecutor Andrew Marshall said that the door “could have killed somebody. The fact that it didn’t was because an emergency stop was activated.” During the hearing at Milton Keynes Magistrates’ Court in the U.K., Marshall claimed that the metal door hit the then 71-year-old actor with a force similar to the weight of a small car.

The actor was airlifted to a hospital post the accident and production was halted two weeks.

“Star Wars: The Force Awakens” director J.J. Abrams later said that when Solo returned to the set he was “better and stronger than ever, I can’t overstate that. There was a fire in his eyes that you see in the movie.”

"Star Wars Episode VIII" is in the works at the Pinewood studios and is slated for a December 2017 release.