A wandering bear that scared residents of a Japanese city just north of Tokyo was captured on Tuesday after several days of panic during which all schools were closed.

The bear was first spotted on Saturday near a park in Utsunomiya, a city north of Tokyo with a population of half a million.

City officials have said they received dozens of reports of bear sightings in the following days, including near a library, schools and a community center, causing them to close all city-run schools Monday and Tuesday.

The city issued bear warnings via social media and dispatched a public announcement vehicle, urging residents to take shelter inside buildings and vehicles if they encounter a bear, and to make sure to lock doors and windows and not to put out garbage at night.

On Tuesday afternoon, the bear was found on a private property and shot by a veterinarian with a tranquilizer gun, city official Ryuhei Irie said. Nobody was injured.