An 18-year-old gunman opened fire on passers-by as well as houses and cars in a New Mexico neighborhood, killing three people and wounding six others before police killed him outside a church, authorities said.

The incident occurred yesterday, Monday, around noon in the Farmington district, located approximately 290 kilometers northwest of Albuquerque, the state capital.

When police arrived at the scene, they were “encountered with scenes of chaos, with a man shooting at bystanders in the neighborhood,” Farmington Police Chief Barrick Crum said at a news briefing.

Three people were killed and six others were wounded, including two officers who were hit during an exchange of gunfire with the gunman before he was fatally wounded by police, Farmington police spokeswoman Shanice Gonzalez said.

According to her, the 18-year-old traveled a distance of about 500 meters shooting at passers-by indiscriminately, before being confronted by the police outside a church.

His motive is not known, she clarified.

The suspect appeared to shoot “whatever came into his head” and used at least three weapons, one of which was an AR-15 semi-automatic rifle, Farmington Police Chief Steve Hebe noted, adding that the gunman fired at “at least six houses and three cars”.

So far police have only released the age of the attacker, who appears to have acted alone. No information has been released about the dead.

The two policemen are hospitalized in a stable condition, while the condition of the four citizens who have been injured is not known.

Part of the carnage was captured on video posted to TikTok, with Gonzalez confirming the footage is authentic.

The video shows a man dressed in black walking outside the First Church of Christ Scientist holding what appears to be a handgun, before being shot dead by police.

The man who took the video can be heard describing the scene to someone else and telling them that the suspect is walking in circles outside the church. He is then heard saying: “a man is lying in the middle of the road.”

In April, Farmington police killed a gunman at his home and then exchanged gunfire with his wife after officers went to the wrong home on a domestic violence call.

Also in December 2017, a gunman opened fire at a high school in Farmington, killing two students before killing himself.

Yesterday’s massacre is the latest of at least 225 such incidents recorded in the US this year in which four or more people have been killed or injured, according to the Gun Violence Archive.