DENVER (Reuters) - Wildlife rangers in Colorado on Monday shot and killed a black bear suspected of attacking and trying to drag off a five-year-old girl from her yard.

The attack occurred early Sunday morning when the girl went outside to check on a noise she thought her dog had made and her mother heard screaming, officials said.

“When she went outside to investigate, she witnessed a large black bear dragging her ... daughter,” the Colorado Parks and Wildlife agency said in a statement.

The bear dropped the child after her mother yelled at it, officials said. The attack took place in East Orchard Mesa, a small community about 250 miles (400 km) west of Denver.

The child, whose name was not released, was in fair condition early on Monday at a local hospital, NBC affiliate KKCO said.

Wildlife agents set up traps and deployed tracking hounds in an effort to locate the bear, said Mike Porras, a spokesman for the state parks agency’s northwest region office.

He said agents were monitoring the traps overnight when they observed a bear approaching a home about a half-mile (0.8 km) from where the attack on the girl occurred. They shot it before it entered a trap.

“Based on the description of the bear and that it returned to the same general area, we believe it is the same animal,” Porras said by telephone.

Colorado has a “robust” population of about 18,000 black bears, he said, noting that unprovoked attacks by black bears on humans are rare.

The bear’s carcass will be shipped to the agency’s laboratory for a necropsy to determine if DNA testing can confirm it was the animal that attacked the girl and to assess its overall health, Porras said.