Rescue crews saved a moose struck on an active railroad bridge in Vermont on Wednesday after the state’s Department of Fish and Wildlife received a report of the animal getting its hoof stuck in one of the tracks.

Crews carried the moose miles away from town and unloaded it into the woods so it could return to its natural habitat.

“Vermont game wardens and wildlife biologists with assistance from the Springfield Fire Department and a crew from the Vermont Rail System were able to sedate the moose, pick it up with a railroad crane truck, and relocate it to a safe area where it could return to the wild with minimal injuries,” the Vermont Department of Fish and Wildlife said in a Facebook post.

Officials said the moose handled the transport well, getting back on its feet and walking back into the woods away from the railroad tracks, WPTZ reported.

Vermont’s Department of Fish and Wildlife added that such rescues are rare because of the risk to both the animal and the rescue crews in those situations.

“Such recoveries are many times not successful,” the department said. “It’s great to see that, in this case, it ended well for those involved and for this very fortunate moose. A great job by all, and a special thanks from the Vermont Fish & Wildlife to those who helped in this effort.”