Using ropes, pulleys and sedatives, Prince George’s County firefighters freed a man whose legs had become entangled in a heavy-duty piece of equipment at a Laurel-area mulch plant, authorities said Tuesday.

The man, a worker at the plant, was critically injured but is expected to survive, said Mark Brady, a Prince George’s County Fire/EMS Department spokesman. He said it took rescuers about 90 minutes to free the man from time they were first called, and he now has “a long road to recovery with the injuries to his legs.”

“It was certainly a challenge, but we were successful,” Brady said.

Emergency workers were first called about the incident at Grant County Mulch in the 5400 block of Van Dusen Road about 11 a.m., Brady said. He said they arrived to find a worker whose legs had become entangled inside of a nearly 15-foot tall machine that injects dye into mulch to give it color.

The worker, a man in his 50s, was “conscious and alert and in extreme pain,” Brady said. His predicament, Brady said, was thought to be a “life-or-death situation.”

Prince George’s County firefighters had to sedate a man and maneuver his legs out of a dye machine at a Laurel-area mulch plant Tuesday. The man was critically injured but expected to survive. (Mark Brady/Prince George's County Fire/EMS)

Investigators are still exploring why the man was standing in the 15-foot tall dye machine when its equipment was set in motion. (Mark Brady/Prince George's County Fire/EMS)

The man was apparently standing in the machine when the mechanism that typically feeds mulch through was set in motion, Brady said. The man’s legs, he said, became pinned against the wall of the machine’s hopper in such a way that firefighters could not simply cut him out.

They called in a surgical rescue team from the University of Maryland R Adams Cowley Shock Trauma Center, Brady said.

An anesthetist sedated the man, which allowed rescuers to maneuver his legs out of the machinery without causing him any further injury, Brady said. They then used ropes and pulleys to bring him to safety, Brady said. He was transported to a nearby hospital for further treatment of his injuries, Brady said.

Brady said he was unsure why the man was standing in the dye machine in the first place. Shannon Davis, a spokeswoman for the Maryland Department of Labor, Licensing and Regulation, said Maryland Occupational Safety and Health investigators were probing the incident but could not immediately make public why and how the man got caught in the machine.

This post has been updated.

Related: The Post’s public safety coverage