Two people have been killed and four have been left injured after a gunman opened fire at a library in New Mexico, it has been reported.

NBC News reported that at least six people were shot in the Clovis-Carver library in Clovis, which is located near the border with Texas.

The Eastern New Mexico News reporting there were "multiple fatalities" and that a suspect has been arrested.

Library patron Vanessa Aguirre said she was in the library with her son when a man came in and "started to shoot" into the air. "It all happened so fast," she told the newspaper. "We took off fast. My purse is still in there."

Clovis, which has a population of about 40,000, is about 310km east of Albuquerque and is near Cannon Air Force Base.