A Santa Maria man was sentenced Tuesday in Santa Barbara County Superior Court to 18 years in state prison for an attempted-murder that occurred last year. 

Junior Freddy Martinez, 24, was arrested in April 2022 after he fired several shots at a vehicle on a street during the afternoon in northwest Santa Maria , according to the Santa Maria Police Department.

The shooting occurred near Alvin and Railroad avenues, where a man said he and his young son were stopped at the intersection when a car pulled alongside of his, and an occupant of the other vehicle starting shooting at him, according to police.

The suspect vehicle fled east on Alvin Avenue at high speed before crashing about two blocks away near Curryer Street, according to police.

Two female occupants of the car were arrested on suspicion of various misdemeanor charges, while the lone male occupant — later identified as Martinez — fled into the residential neighborhood.

Officers canvassed the area, with the assistance of a Santa Barbara County helicopter, but were not able to immediately locate Martinez, police said.

After a few hours, residents noticed a suspicious individual in their backyards, and Martinez was taken into custody without incident.

The firearm he used was recovered during the investigation, they added.

Martinez changed plea his plea to guilty in August, according to Deputy District Attorney Austin Ingalls.

In addition to attempted murder, Martinez also admitted a special allegation, or sentencing enhancement, that he personally used a firearm during the crime. 

The sentencing hearing occurred before Judge John McGregor.

With the attempted-murder charge and multiple special allegations he initially faced, Martinez could have spent up to 28 years in state prison if found guilty of all the charges.

Martinez has remained in the custody of the Santa Barbara County Jail since his arrest. 

Noozhawk North County editor Janene Scully can be reached at jscully@noozhawk.com. Follow Noozhawk on Twitter: @noozhawk, @NoozhawkNews and @NoozhawkBiz. Connect with Noozhawk on Facebook.