A legendary brown bear in Japan that earned the nickname "Ninja" because of its ability to elude authorities after attacking livestock was killed by hunters.

The bear, which was officially named "OSO18," is believed to have attacked at least 66 cows since 2019 in Hokkaido, Japan, but was shot dead late last month by hunters, according to a report from CBS News.

The bear became infamous for its ability to elude efforts to capture it and confused experts because of its habit to not eat the dairy cows it attacked, only killing about half of its 66 victims.

MAN INJURED IN GRIZZLY BEAR ATTACK WHILE SURVEYING WYOMING FOREST

Hunters search for bear in Japan

Hunters search for a brown bear in Sapporo, Hokkaido prefecture on June 18, 2021. Officials warned residents to stay home after the animal injured four people, including a soldier. (STR/JIJI Press/AFP via Getty Images)

Authorities said the three-year search for the bear included the use of traps, fences and cameras, according to Kyodo News. Authorities also set up machines that emitted light and noise in a bid to prevent future attacks.

But the bear was finally taken out by hunters last month, with authorities able to confirm its identity with DNA testing.

"A brown bear was hunted on July 30, and various analyses, including DNA testing, resulted in a confirmation that it was OSO18," Hokkaido government official Tadayoshi Takeda told reporters, according to CBS News. "I am sure local residents are relieved to hear this news."

Brown bear in Japan

A brown bear in the spa town of Noboribetsu Onsen, Shikotsu-Toya National Park, Hokkaido, Japan. (DeAgostini/Getty Images)

Seiichi Sugiyama, a senior official of the Hokkaido prefectural government's regional bureau in Kushiro, said Tuesday that the bear's attacks on cattle were estimated to have cost at least 23 million yen, or $158,000 in damages.

"Hopefully local residents will feel relieved," Sugiyama said, according to Kyodo News.

According to CBS, Hokkaido is the only region of Japan where brown bears live and their population is estimated to be about 12,000. But that population is growing, causing more conflicts with humans as the bears become more likely to search inhabited areas for food. Authorities believe a bear was responsible after a human head was found near a lake in Hokkaido in May, saying the victim was likely mauled and decapitated by a brown bear.

PENNSYLVANIA MAN BIT IN HEAD BY BEAR RECOUNTS TERRIFYING ATTACK: IT 'BLINDSIDED' ME

Bear and cub in Japan

A brown bear and a cub eat salmon along the Sea of Okhotsk near the town of Rausu on Sept. 28, 2019, in Hokkaido, Japan. (Salwan Georges/The Washington Post via Getty Images)

The region also set a record in 2021 for incidents involving bears in the area, with four people being killed and 10 injured during while encountering bears. Authorities also estimate bears were responsible for about $2 million in damage to crops in the region, which was the highest total on record.

CLICK HERE TO GET THE FOX NEWS APP