The man accused of kidnapping and torturing a woman in Oregon killed two men before fatally shooting himself during an hourslong standoff with law enforcement officers, authorities said Wednesday.

Benjamin Obadiah Foster, 36, died at a hospital Tuesday night after he shot himself while he was barricaded underneath a house in Grants Pass, Oregon, police said Wednesday. Foster was wanted for attempted murder, kidnapping, and assault, according to the Grants Pass Police Department.

Foster died overnight of a self-inflicted gunshot wound to the head after authorities extracted him from the Grants Pass house late Tuesday, according to the Grants Pass Police Department.

The standoff occurred after police said Foster was seen walking a dog in the Grants Pass area Tuesday morning. Authorities said Wednesday that Foster was found under the house where the alleged torture and kidnap of the Grants Pass woman took place.

Police said Wednesday that during the search for Foster, authorities found the bodies of two men in a rural area north of Grants Pass. The men apparently did not know Foster, who police said left a gruesome scene and stole some of the victims’ belongings, including their dog.

The attack on the woman and the ensuing manhunt by local, state, and federal agents rattled residents of Grants Pass, a city of about 40,000 in southwest Oregon. Authorities previously called Foster “extremely dangerous” who spent time behind bars in Nevada for a similar crime.

“We are confident that the community is safe,” Grants Pass Police Chief Warren Hensman said during a Wednesday news conference.

OREGON TORTURE CASE:Man suspected of torturing woman in Oregon using dating apps to find victims, authorities say

ATTEMPTED KIDNAPPING OF BARISTA ARREST:Suspect arrested after attempted drive-thru kidnapping of barista caught on video in Auburn, Wash.