CHICAGO — Chance the Snapper, the elusive alligator that mesmerized a mostly alligator-free Midwestern city, has been caught.

A hunt for the animal, which was first spotted a week ago in a city park lagoon on Chicago’s West Side, had gone on day and night, drawing thousands of curious residents, setting off a frenzy on social media, and spurring T-shirts and a naming contest.

The local authorities, including a volunteer from the Chicago Herpetological Society named Bob who paddled around in a canoe, turned out not to be enough to corral the creature, so an alligator expert from Florida was flown in.

After staying up for some 36 sleepless hours and making alligator calls on the shores of the lagoon, the expert, Frank Robb, finally emerged from the lagoon with the quarry, which had apparently been resting near some lily pads.