KALISPELL, Mont. (AP) - A 21-year-old Kalispell man has been sentenced to 10 years in prison for shooting at a Flathead County sheriff's deputy while under the influence of the synthetic drug "bath salts."

Bryson Patrick Connolly pleaded no contest to attempted deliberate homicide and assault on a peace officer. The Daily Inter Lake reports District Judge Stewart Stadler sentenced him Monday to 40 years in prison with 30 suspended.

Prosecutors alleged Deputy Roger Schiff tried to stop Connolly's vehicle in August 2011 and that Connolly responded by firing 15 rounds from an AK-47 at Schiff's patrol car, hitting it three times. Schiff was hit by flying glass.

Connolly apologized to Schiff and his family and said he couldn't remember the shooting. The federal government declared bath salts illegal in October 2011.