It happened in Discovery Bay near Bixler Road.
Deputies responded to the scene and found a highly aggressive bull.
RELATED: Cows, bulls wreaking havoc in South San Jose
They fired shots to try to scare the bull when it approached first responders, but then had to put the bull down to protect them.
Firefighters had found the rancher who was pronounced dead at the scene.
Officials have not released information on a potential cause of death.