A grizzly bear that fatally mauled a woman on a forest trail west of Yellowstone National Park in July and also attacked a person in Idaho three years ago was killed after it broke into a house near West Yellowstone over the weekend, Montana wildlife officials said Wednesday.

Early Saturday, a homeowner reported that a bear with a cub had broken through a kitchen window and taken a container of dog food, Montana Fish, Wildlife and Parks said in a statement.

Later that day agency workers captured the cub and shot the 10-year-old female grizzly with authorization from the U.S. Fish and Wildlife Service, because grizzly bears are protected under the Endangered Species Act.

FLORIDA WOMAN SURPRISED BY BEAR OUTSIDE HER DOOR, DOORBELL CAMERA FOOTAGE SHOWS: ‘I GOT A SURPRISE’

lake seen near mountain

The Bear tooth Lake is seen in the Shoshone National Forest near the Yellowstone National Park. A grizzly bear blamed for mauling a hiker near West Yellowstone has been killed.  (Education Images/Universal Images Group via Getty Images)

Through genetic analysis and other identifying factors, the bear was confirmed to have been involved in the July 22 fatal attack on Amie Adamson, 48, a former teacher from Kansas, about 8 miles from West Yellowstone. Efforts to trap the bear at that time were unsuccessful.

The bear, which had been captured in 2017 for research purposes, was also involved in an attack in Idaho that injured a person near Henrys Lake State Park in 2020. The park is 16 miles by road from West Yellowstone.

CLICK HERE TO GET THE FOX NEWS APP

Both encounters with people were believed to have been defensive responses by the bear, officials said.

The bear's 46-pound male cub is being held at the state wildlife rehabilitation center in Helena while arrangements are made to transfer it to a zoo.