The fugitive goat of Inver Grove Heights is now in custody after days on the lam in the St. Paul suburb.

The wily goat — Billy the Kid, perhaps? — had eluded repeated attempts to corral it before Inver Grove Heights police officers were finally able to capture it, humanely, on Thursday morning.

"After an extended search, countless calls and some help from a resident, the goat is resting safely in a pen in the police department garage," the police department reported in a Facebook post. "He's actually pretty tame, but was obviously afraid."

The goat tasted freedom for about a week before police made the, uh, arrest. Inver Grove Heights police via Facebook

The goat will be taken to a Minnesota-based shelter for farm animals, the department announced.

Police Chief Paul Schnell told MPR News that the goat hadn't been seen for a couple days before a resident spotted it Thursday morning.

"We got a call — a person who lives in a more rural area ... had kind of corralled the goat. The officers went down there and were able to secure it, and it was brought back to the police department," he said.

"Once it got to the police department we had to use a dog kennel, which he fits in just fine. But it's certainly not what a goat that's been on the run is used to."

The animal will be examined by veterinarians at the University of Minnesota before going to its new home.

The Inver Grove Heights 40-officer force handles animal control calls in the city and police said earlier in the week that they weren't sure where the goat came from.

Schnell said there are farms on the southern edge of the St. Paul suburb, although no one reported the animal missing. But plenty of residents reported seeing the goat, which strolled in and out of people's back yards and occasionally peered through people's patio doors.

The goat was seen wandering around the city over the past week, its intentions unclear. Inver Grove Heights police via Facebook

Authorities had been concerned the goat might wander onto nearby freeways. The department tried luring the goat with food for several days before the successful capture.

The department reported on Facebook that Schnell "sent out a challenge to the patrol teams that he'd buy the team that the captured the wily creature alive, all the pizza and Buffalo Wild Wings they could eat. We're guessing the chief's probably filled with regret right now; this team is filled with big eaters."

Schnell said it was a good outcome for all involved.

"A happy ending — we're grateful for everyone's interest. It's not quite a raccoon going up the side of a skyscraper," he quipped, "but it's nonetheless meaningful for Inver Grove Heights."