One of the production companies behind “Star Wars: The Force Awakens” has plead guilty to criminal charges stemming from an accident which left Harrison Ford with a broken leg.

The 74-year-old actor was hit with a metal door on the set of the film in June 2014. Foodles Production (UK) Ltd., which is a subsidiary of Disney, admitted to being guilty of two out of four criminal charges in court this week. The remaining two charges were withdrawn. The company will be sentenced on August 22.

RELATED: Harrison Ford Makes Lego Debut In ‘LEGO Star Wars: The Force Awakens’

Prosecutor Andrew Marshall described the accident to the court.

Ford had passed through a hydraulic metal door on the “Force Awakens” set, hitting a button before starting to walk back through it, believing that the set was not live and the door would not close. The door was remotely operated by another person and as Ford passed through it, he was hit in the pelvic area and pinned to the ground. The Health and Safety Executive (HSE), which initiated the prosecution, said Ford was “badly injured after he became trapped under a rapidly closing metal-framed door.”

RELATED: Harrison Ford Mistakenly Given Criminal Record By Police

Marshall argued that the door posed a “risk of death”, according to BBC News. “It could have killed somebody. The fact that it didn’t was because an emergency stop was activated,” he said. A spokesman said that the power of the door’s drive system was comparable to “the weight of a small car” and that this was “a foreseeable incident.”

Foodles Production Ltd. released a statement citing “The safety of our cast and crew was always a top priority throughout the production” and has provided full-cooperation throughout the investigation.