Authorities say a police officer has shot and killed a motorist who tried to take the officer's gun after a pursuit ended in a crash in western Kansas.

The Ellis County prosecutor said in a news release that the chase started early Tuesday after a Hays officer attempted to stop the white driver for crossing the center line. The motorist reached speeds of more than 100 mph before crashing while attempting to pass another vehicle on U.S. 183.

The release says the officer used a stun gun when the driver attacked. The two tussled on the ground before the driver was fatally shot while attempting to take the officer's gun.

The officer was treated at a hospital and released. The name of the suspect and the officer weren't immediately released.