HELENA (AP) – Montana wildlife officials say a 38-year-old mountain biker who was killed by a bear riding just outside Glacier National Park likely collided with the bear before he was attacked, and they have called off the search for the bear.

Wildlife response team investigator Brian Sommers said in a statement Saturday that he believes Treat was riding at a high rate of speed along a narrow trail and hit the bear. Visibility was limited and investigators believe the collision was unavoidable.

Brad Treat, who was a law enforcement officer with the U.S. Forest Service, was found dead on June 29 by officers at the scene of the mauling. Treat’s riding companion reported the incident and was not attacked.

Montana Fish, Wildlife & Parks spokesman Ron Aasheim said it was a tragic accident. Investigators are still trying to determine if it was a black bear or a grizzly, and whether it might have been a female bear trying to protect her cubs. Investigators have removed cameras that were being used to find the bear, along with traps that were placed in the area.

“This is an area of pretty high density of bears, and the bear didn’t return,” Aasheim said. “It was just a horrible accident. The bear was in a defensive mode responding.”

Authorities are still awaiting DNA tests that will show if the bear was male or female, and whether records show it might have been responsible for previous attacks.

National Forest spokeswoman Janette Turk said the attack occurred in a heavily forested area, and the area has been closed off.

An autopsy on Treat could help determine the size, age and sex of the bear, Flathead County Sheriff Chuck Curry said.

Treat became a Forest Service law enforcement officer in 2004. He spent the last 12 years stationed at the remote Hungry Horse District in the Flathead National Forest, where the territory stretches into the untamed Great Bear Wilderness.

Copyright 2016 Associated Press. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.