A black bear in Mexico that went viral after sniffing a hiker’s hair has been caught and castrated, authorities say.

The move, which was taken amid concerns about the bear’s overfamiliarity with people, has sparked outrage.

Remarkable video footage shows the young 212-lb bear approaching the woman on a hiking trail at Chipinque Ecological Park in San Pedro Garza García Municipality and sniffing her hair. The video, which emerged last month, quickly became a viral sensation. The hiker, who took a selfie with the bear, was praised for staying calm during the incident.

HIKER PRAISED FOR REMAINING CALM AS BLACK BEAR APPROACHES HER, SNIFFS HER HAIR IN INCREDIBLE VIDEO

A black bear eating clover. (iStock)

The BBC reports the animal had been dubbed “the friendly bear” by locals. It was also known as “Chipi” after the ecological park in the Mexican state of Nuevo Leon.

The decision to castrate the bear was made on account of its “erratic” behavior, his safety, and the safety of the local population, according to officials. The bear had been returning to eat garbage in urban areas of ​​San Pedro Garza García. A decision was also made to transfer the animal to Sierra de Nido in the Mexican state of Chihuahua and the castration aims to reduce the likelihood of the bear fighting other bears in its new home, officials said.

Social media users expressed their anger over the bear’s castration.

“There is outrage in Mexico after a black bear seen on video approaching a visitor in a nature park and sniffing her hair was caught castrated, and is being sent interstate. Locals are rightly livid that this is happening to the ‘friendly bear,'” tweeted Xpose Trophy Hunting.

AMID CORONAVIRUS CLOSURE, YOSEMITE'S BEARS ARE MAKING THE MOST OF THE PEACE AND QUIET

Mexico’s Federal Attorney for Environmental Protection (PROFEPA) has ordered an investigation into the decision to castrate the bear.

CLICK HERE TO GET THE FOX NEWS APP

Mexican black bears are found in the states of Sonora, Chihuahua, Coahuila, Nuevo León, Zacatecas and Durango, as well as in the Chisos Mountains in Texas, according to Bear Conservation. "Mexico has listed black bears as in danger of extinction," it explains, on its website. Mexico News Daily reports that the bears are protected by law in Mexico.

Fox News’ Alexandra Deabler contributed to this article.