A gunman in Bakersfield, Calif., went on a killing spree through the city on Wednesday night, fatally shooting five people — including his wife — and stealing a vehicle before being confronted by a sheriff’s deputy and killing himself, the authorities said.

The series of shootings in Bakersfield — about 115 miles north of Los Angeles — began around 5:20 p.m. and unfolded in about 15 minutes, Sheriff Donny Youngblood of Kern County said at a news conference late Wednesday.

The authorities did not immediately release the names of the victims or the gunman.

“Obviously there’s some type of situation that caused the husband to be extremely upset,” he said.

He added later: “We’re trying to find the connection. Obviously these are not random shootings.”

The events began to unfold when the suspect, who was armed with a handgun, and his wife entered a trucking business, Sheriff Youngblood said. They confronted a man at the business; the husband shot and killed the man, and then turned and shot his wife, the sheriff said.