(CNN)A couple was attacked by a bear inside their northern Wisconsin home Friday night after the animal broke through their window, authorities said.
The husband and wife were both injured, but their children -- who were asleep in their bedrooms at the time of the attack -- were unharmed, the Taylor County Sheriff's Office (TCSO) said in a news release. The husband shot and killed the bear.
The couple first saw the bear outside eating from a bird feeder, so they opened their window and yelled at it to try to get it to leave, TCSO said.
"The bear immediately turned and charged at the house, breaking through the window and into the house and immediately attacked," TCSO said.
Both the husband and wife sustained several bites and injuries as they tried to fend off the attack, at one point stabbing the bear with a kitchen knife, authorities said. Eventually, the husband was able to get a firearm and shot and killed the bear.
The pair was treated for their injuries at a hospital and have since been released, TCSO said.
The bear, identified by authorities as an adult female, appeared to have a cub, which was seen running off as the bear charged the house.
According to the Wisconsin Department of Natural Resources, bears are typically afraid of humans and are rarely aggressive. However, they may become defensive when protecting their cubs or a food source and could get agitated if they are startled, the department said.
In cases where people see a bear in their yard or around their house, the Wisconsin DNR has previously recommended people get to "a secure area so the bear has a clear escape path" and making "a lot of noise by yelling, honking a car horn or banging pots and pans."
The Department of Natural Resources took the deceased bear for testing, the release said.