A five-hour standoff in Taylorsville between police and a man who was barricaded and possibly armed ended peacefully when the man surrendered to authorities.

SWAT team members surrounded a Taylorsville apartment, near 4100 South and 1300 West, at about 5 a.m. Thirty-one other units in the apartment complex were evacuated during the standoff.

The incident began at about 1 a.m. when the man arrived home and began making threats against himself, said Taylorsville police detective Troy Martinez.

The man's wife left the residence. She was never held against her will, Martinez said.

The SWAT team was called about 5 a.m. The wife confirmed to investigators that she saw her husband holding a gun and that he had weapons inside the house. After negotiations over the phone the man surrendered at about 10:15 a.m., Martinez said.

The man was taken to a local hospital for a psychological evaluation, he said.