A parolee arrested at a Ukiah motel after a tense standoff with Mendocino County authorities had a loaded handgun in his room and repeatedly threatened to take his own life before he finally surrendered Wednesday evening, a sheriff's official said.

Walter Kristopher Miller, 42, eventually agreed to come out peacefully and face arrest on suspicion of attempting to kill a sheriff's deputy. But it wasn't until he was in custody that authorities felt certain there would be no more violence, Mendocino County Sheriff's Lt. Greg Van Patten said.

"He definitely had the capability to shoot it out if he wanted to shoot it out," Van Patten said Thursday.

Miller is being held without bail at the Mendocino County Jail and faces a return to state prison if convicted in the current case.

If, as authorities suspect, he was the man who fired shots at a deputy during a Monday night vehicle pursuit, he already had demonstrated his desire to avoid arrest, Van Patten said.

"Going into this situation, that was the information we had: that he wasn't going to go peacefully," Van Patten said. "And obviously that was in line with the behavior that we saw Monday night, with the deputy getting shot at."

But authorities negotiated with Miller via phone for several hours Wednesday, and he eventually agreed to give up if his Sonoma County parole agent was present.

Authorities say Miller and a second man, Christopher Skaggs, were the occupants of a 1995 Ford Thunderbird that the deputy, a 23-year department veteran, attempted to stop for an expired registration in south Ukiah late Monday night.

A pursuit ensued, during which a passenger in the car, believed to be Miller, fired numerous shots at the pursuing deputy, eventually disabling his car. The deputy was uninjured.

Miller and Skaggs then abandoned the vehicle in a private driveway off Highway 253 in a rural area west of Ukiah and escaped on foot -- Skaggs until he was arrested on a Ukiah street Tuesday morning, and Miller until his arrest Wednesday night.

The car yielded evidence linking the two to an earlier residential burglary in Potter Valley, though five firearms taken from the home were missing, authorities said. Miller was believed to have at least one.

While authorities in two counties were searching for Miller, it appears he spent most of that time holed up in a second-floor room at the Best Western/Orchard Inn off South Orchard Avenue in Ukiah, Van Patten said.

Miller probably hid in the room for about 24 hours and apparently had at least one visitor, a woman, during that time.

But he apparently had no inkling that law enforcement officers had surrounded the motel and deployed a SWAT team inside the motel until authorities contacted him to negotiate a surrender.

"We definitely had the element of surprise, so I think that really prevented him from being able to escalate the situation at that point," Van Patten said. "From that point, it was just a matter of being able to weigh his options."

Miller's room had only one door, leading to an inside hallway. Deputies had gathered in the hall after evacuating the motel. If he'd gone out a window, he would have faced a two-story fall, Van Patten said.

A later search of the room turned up an AP 9mm machine pistol believed to have been stolen in Potter Valley and fired at the deputy. Authorities also recovered two loaded high-capacity magazines, with 20 and 30 rounds each.

Detectives still are investigating whether Miller had help getting back to town or concealing himself, and will not be releasing the targeted deputy's name until it's clear all those connected to the case are off the streets, Van Patten said.

Miller and Skaggs, who also is being held without bail, both are being held without bail after their arrests on suspicion of attempted murder, conspiracy, burglary, robbery, unlawful possession of a firearm and other charges.