Two men were killed and one was injured in two separate shootings in Lompoc on Sunday, according to police.

Officers responded to a report of the first shooting in the 500 block of North M Street shortly before noon and, upon arrival, located a 27-year-old male who had sustained gunshot injuries, according to Lompoc Police officials. 

The man, who wasn't identified, was transported to a local hospital where he died from his injuries, according to officials. 

Detectives had almost finished processing the crime scene from the first shooting when the second shooting was reported a little more than two hours later. Detectives said they could hear the gunshots from the scene. 

Police responded to the second shooting in the 300 block of West Maple Avenue shortly after 2 p.m. and located a 31-year-old man and a 20-year-old man who had sustained gunshot injuries. They both were transported to a local hospital.

The 20-year-old man died from his injuries, while the 31-year-old man was treated for a nonlife-threatening gunshot wound and later released, according to officials. Neither of the men were identified. 

The names of the deceased victims are being withheld until their families are notified, according to the Lompoc Police Department. 

Officials haven't said if there's a connection to the shootings, which are under investigation.