The gunman charged with killing a rookie Sacramento police officer and engaging law enforcement in an hours-long standoff used two assault rifles and two other guns that he had "strategically" placed inside a barricaded home, police said Friday.

"This was an ambush-style attack on Sacramento officers that lasted for hours," Chief Daniel Hahn said at a news conference in which authorities detailed the Wednesday shooting that killed 26-year-old Officer Tara O’Sullivan.

Adel Sambrano Ramos, 45, was charged Friday with murder, attempted murder and other counts in the shooting and standoff that began as officers attempted to help a woman get her belongings after a dispute with the suspect, authorities said.

O'Sullivan was wounded in the shooting that erupted around 6:10 p.m., and it was around 40 minutes before police were able to rescue her from the back yard with an armored vehicle.

O'Sullivan, who graduated from the police academy in December, was hit by multiple rounds, police Sgt. Vance Chandler said Friday.

When the armored vehicle broke through a fence from an alley to get to the wounded officer, Ramos shot at it, Chandler said. One officer exited and returned fire while other officers rescued O’Sullivan, according to the sergeant's account.

Officer Tara O' Sullivan. Sacramento Police Department / AP

After shooting O’Sullivan, Ramos continued to fire at police for around four hours, Hahn said.

Ramos allegedly fired on at least 30 occasions during the standoff and surrendered shortly before 2 a.m. Thursday. He was not injured. Police returning fire shot at least 100 rounds, Chandler said.

There are two buildings on the property, a main residence and detached garage, and the door of the residence was barricaded from the inside when police initially arrived, Chandler said.

Ramos was inside the residence, which had surveillance cameras on the outside, and stayed there firing at officers throughout the standoff.

Four weapons — described as two assault-style rifles and a shotgun and handgun — were inside that residence, and the suspect shot all four weapons at police during the situation, Chandler said.

Police said they also found two other firearms in the detached garage. Police showed photos of the rifles, one of which appeared to have a scope attached and large-capacity magazines.

A criminal complaint described at least one of the rifles used as a .223-caliber assault rifle. It also says that he is charged with possessing two AR-15 style rifles built on unfinished 80 percent receivers, suggesting that they are so-called "ghost guns," although that term is not used in the documents.

Ramos is expected to be arraigned Monday. A spokeswoman for the Sacramento County District Attorney’s Office said the charges he currently faces could change.