When officers went to the man’s room, he yelled through the door, threatening to kill officers, police Lt. Jason Jackowski said. The man also took out a handgun, which officers saw through a window, the lieutenant said. Officers evacuated several areas of the motel. The SWAT team responded, along with crisis negotiators, who called the man’s cellphone and talked with him for several hours, Jackowski said. About 2:40 p.m., the man walked out of his room and was taken into custody. Officers served a search warrant and found an automatic handgun and sword in the room, Jackowski said. He said the man — a resident of Lomita in Los Angeles County — was taken to a hospital for a medical evaluation. The man was later booked into Vista jail on suspicion of resisting officers and brandishing a weapon, according to jail records.