CLOVIS, N.M. (AP) — A shooting inside a public library that killed two people and wounded four has deeply shaken an eastern New Mexico community.

The gunman surrendered after the shooting Monday and was taken into custody without incident after police entered the Clovis-Carver Public Library, authorities and elected officials with the city of Clovis said during a news conference. Warrants for his arrest were being prepared, but it's wasn't immediately clear what charges he would face.

Clovis Mayor David Lansford said things could have been much worse had it not been for the quick response, training and courage of police. He called the shooting tragic and senseless.

"This is a big blow to our community," he said. "Our community is a community that places a high value on life and the sanctity of life. And each life that lives in this community is precious. So we're all hurting right now as a result of what took place this afternoon."

Clovis, a city of about 40,000, is about 200 miles east of Albuquerque, near the Texas state line. The area is home to Cannon Air Force Base. The nearby community of Portales is home to Eastern New Mexico University.

The injured included two men and two women, authorities said. Some were taken to a hospital across the state line in Lubbock, Texas. The extent of their injuries was not immediately known.

One woman was seen being helped into an ambulance while a call for air ambulances could be heard over police radio traffic.

The names of the victims and the gunman were not released.

A woman who was in the library when the man started shooting said the man told her to run, the Eastern New Mexico News reported Monday night.

Lisa Baird told the newspaper that she was about 20 feet from the man as he opened fire inside the library.

"Run!," he yelled at her. "Why aren't you running? I'm shooting at you! Run!"

Baird talked to the newspaper through Facebook Messenger. She said she was talking with a library patron when she says she heard a "very loud bang."

"My initial thought was why would someone throw a cherry bomb or M80 firecracker into the library? Then I saw a young man aim his hand, which had a handgun in it, to the ground/carpet about 6 feet in front of him and he fired like four or five shots into the carpet," she said.

She dove under a nearby desk "and tried to squish up as small as possible," Baird said.

From there, Baird said she could hear the man moving around the library and firing multiple shots.

"Then I heard his pants 'shooshing' as he approached the end of the reference desk. I heard a sound like a phone or something being put on the reference counter at the end of the desk, about 4 feet from my head," she said.

Then police entered the library and began shouting for the man with the gun to "lay on the ground" repeatedly, Baird said.

Police Chief Doug Ford says the suspect did not resist after police arrived.

Police said they were still working to process the crime scene and piece together what happened. Ford could not immediately say what kind of gun was used in the attack.

Top elected officials from across New Mexico issued their condolences for the victims and their support for the community. Gov. Susana Martinez called it a "horrific attack."

"In the coming hours and days we will learn more information about this despicable act, but for now I ask all New Mexicans to pray for the victims and their families, and for the entire Clovis community," said Martinez, a former prosecutor.

Attorney General Hector Balderas said his office has reached out to the local district attorney to offer its help.

Sojung Her, a 26-year-old cashier at the Shogun Japanese Steakhouse within view of the library lawn, said the shooting left behind a sense of fear and vulnerability.

"It's kind of a freak thing," she said. "What if he just walked into our restaurant and started shooting?"

Police cars and tactical officers crowded the streets outside as she arrived to work at the restaurant late Monday afternoon.

"This kind of thing never happens here," she said.

Vanessa Aguirre told The Eastern New Mexico News that 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 said. "We took off fast."