Three people were killed in a shooting Thursday at a factory in the US state of Maryland, police said.

A fourth person at the facility was wounded in the shooting, the local sheriff's office said, and a state soldier was also wounded in a shootout with the suspect, according to the New York Daily News.

On the other hand, the Washington County Sheriff's Office stated in a Facebook post, "The suspect is no longer a threat to the community."

The attacker fled the scene after the shooting, and Maryland State Police tracked him to an intersection about 6 miles south.

"Shoots were exchanged between the suspect and the soldier," the sheriff's office said.

"The two were injured and taken to receive medical care," he added.

Mass shootings in the United States have killed 18,574 people so far in 2022, including 10,300 suicides, according to Gun Violence Archives, which monitors shootings across the country.