(KTXL) — A panic alarm helped a Roseville woman whose ex-boyfriend entered her home and attacked her, Roseville Police said. 

Officers responded to the alarm at a home in Roseville Heights, and when they talked to the woman, she initially said everything was OK. 

•Video Above: Sheriff’s Office gives update on Rogue River Dr. shooting in Sacramento County

However, police said officers noticed she was under duress, and they got her to safety. 

According to police, the man had a restraining order against him, and she used the panic alarm to try and get him to leave. Even when officers arrived, he refused to leave. 

Roseville Police said a K-9 unit helped officers search the apartment and found the man hiding under a bed. He was then arrested after telling officers he wanted to surrender. 

The man reportedly had multiple outstanding warrants in Placer County. 

The man was arrested on suspicion of inflicting corporal injury on a spouse, violation of a court order, possession of methamphetamine for sale, child abuse, obstruction, and outstanding warrants.