A man entered the Douglas County (GA) Sheriff's Office Tuesday night seeking shelter, but several hours later a deputy was forced to shoot him inside the facility, officials said.

According to the sheriff and the Georgia Bureau of Investigation, 32-year-old Justin Oakes first entered the lobby of the sheriff's office about 10:25 p.m., where he was offered some water.

At some point, Oakes started making "numerous" 911 calls from the bathroom, according to the GBI. He said someone poisoned him, he gave a false name, and he said “I’m about to be killed,” reports the Atlanta Journal-Constitution.

When two deputies went to check on him about 2:15 a.m. Wednesday, Oakes, authorities said, was barricaded in the restroom. The deputies pushed their way inside, only to discover he had a knife, authorities said.

Deputies deployed a Taser, but Oakes continued moving in their direction with the knife, according to the GBI.

One deputy shot him. Oakes, who had a history of mental illness and was on parole from state prison, died on the scene.

The deputy was stabbed at least twice in the process. The other deputy was also injured during the confrontation. Both were taken to a local hospital and later released.

"The deputy (did) what he was trained to do," Sheriff Tim Pounds said during a morning news conference.