A goat rescue in western Pennsylvania was no kidding matter.

Two goats had to be saved from a perilous predicament when they wandered onto the 8-inch ledge of a bridge beam over the Mahong River in Lawrence County, according to the Pittsburgh Tribune-Review.

The animals had escaped from a local farm before apparently seeking shelter from a light rain on the ledge on the Beaver Valley Expressway near New Castle.

“Borrowing a crane from PennDOT, both goats were rescued and safely returned to their home,” the Pennsylvania Turnpike Commission said on its Facebook page Wednesday.

State troopers spotted the wayward goats Tuesday and called in state workers to assist in the rescue.

They may have been there 18 hours, WGAL-TV reported.