Ventura County sheriff's deputies killed a man armed with a gun in Fillmore after he took a gun to a school Wednesday and later fired at officers, authorities said.

Eric ­Buschow, a spokes­man for the Ventura County Sheriff's Office, said authorities got a report in the afternoon of a man with a chrome handgun in his waistband at Mountain Vista Elementary School.

­Buschow said when officers got to the school, the man was no longer there. But a witness had provided a very detailed description of the man and his vehicle that led officers to a residence in the 700 block of Blaine Avenue, ­Buschow said.

A man holding a handgun and a vehicle matching the suspect description were found outside the residence, sheriff's Capt. Don Aguilar said.

When deputies confronted the man and told him to put the weapon down, he fired the gun, Aguilar said. A deputy then shot the man.

The man was taken to Ventura County Medical Center, where he later died, Aguilar said. ­Buschow said he was 33 years old.

A crowd of onlookers gathered around the alley shortly after the shooting. One of them, Frank Carrillo, said he thought he heard three shots fired.

"It happened quick," Carrillo said.

Fillmore Fire Chief Rigo Landeros said paramedics gave the man oxygen and tried to control the bleeding. Landeros did not provide information on how many times the man was shot or where he was struck.

A command post was set up near the shooting site. Authorities expected to be on the scene for much of the night.

Authorities said the Ventura County Sheriff's Office would conduct an investigation and that any deputies involved would be placed on administrative leave until the District Attorney's Office could review the case.