The man, whose name has not been released, was shot early Saturday morning after he allegedly opened fire at a trailer home and fled in a red truck. No one was injured in that incident.
The San Joaquin County Sheriff's Department says the man's girlfriend later told authorities she had received a call from him in which he threatened to kill himself.
Deputies located the man inside the truck in Lodi. Sheriff's officials say they opened fire after the man failed to drop his weapon and pointed it at them. He was pronounced dead at the scene.