CHARLOTTE, NC — A man armed with a pistol opened fire on students at a North Carolina university during the last day of classes Tuesday, killing two people and wounding four, police said. Officers who had gathered ahead of a campus concert raced over and disarmed the suspect.

The shooting prompted a lockdown at the University of North Carolina-Charlotte and caused widespread panic across campus as students scrambled to take shelter.

"Just loud bangs. A couple loud bangs and then we just saw everyone run out of the building, like nervous, like a scared run like they were looking behind," said Antonio Rodriguez, 24, who was visiting campus for his friend's art show.

Campus Police Chief Jeff Baker said authorities received a call in the late afternoon that a suspect armed with a pistol had shot several students. He said officers assembling nearby for a concert rushed to the classroom building and arrested the gunman in the room where the shooting took place.

"Our officers' actions definitely saved lives," Baker said at a news conference.

He said two people were killed, and three remained in critical condition late Tuesday. He said a fourth person's injuries were less serious. Students were among the victims, but officials would not say how many.

The Charlotte-Mecklenburg Police Department identified the suspect as Trystan Andrew Terrell, 22. They said he's in custody with charges pending.

Monifa Drayton, an adjunct professor, was walking onto campus when she heard the shots. She said she directed students fleeing the scene to take cover inside a parking deck.

"I heard one final gunshot and I saw all the children running toward me," she said. "We started to get all the children pulled into the second floor of the parking deck and the rationale was if we're in the parking deck and there's a shooter and we don't know where he is, he won't have a clear shot."

She added: "My thought was, I've lived my life, I've had a really good life, so, these students deserve the same. And so, whatever I could do to help any child to safety, that's what I was going to do."

The suspect's grandfather Paul Rold of Arlington, Texas, said that Terrell and his father moved to Charlotte from the Dallas area about two years ago after his mother died. Terrell taught himself French and Portuguese with the help of a language learning program his grandfather bought him and was attending UNC-Charlotte, Rold said. But Terrell never showed any interest in guns or other weapons and the news he may have been involved in a mass shooting was stunning, said Rold, who had not heard about the Charlotte attack before being contacted by an Associated Press reporter.

"You're describing someone foreign to me," Rold said in a telephone interview Tuesday night. "This is not in his DNA."

Shortly after UNC Charlotte issued a campus lockdown, aerial shots from local television news outlets showed police officers running toward a building, while another view showed students running on a campus sidewalk.

The Charlotte-Mecklenburg Police Department later said that the campus had been secured and that officers were going through buildings to let people who were hiding know that it was safe to come out.

The university has more than 26,500 students and 3,000 faculty and staff. The campus is northeast of the city center and is surrounded by residential areas.

Spenser Gray, a junior, said she was watching another student's presentation in a nearby campus building when the alert about the shooting popped up on everyone's computer screens.

She said she panicked: "We had no idea where he was ... so we were just expecting them at any moment coming into the classroom."

Susan Harden, an UNCC professor and Mecklenburg County Commissioner, was at home when she heard of the shooting. She went to a staging area, she said, to provide support.

Harden said she has taught inside the Kennedy building, where the shootings occurred.

"It breaks my heart. We're torn up about what's happened," Harden said. "Students should be able to learn in peace and in safety and professors ought to be able to do their jobs in safety."

Gov. Roy Cooper said at a briefing late Tuesday that a "hard look" was needed into how the shooting happened and how to keep guns off campus and out of schools.

"A student should not have to fear for his or her life when they are on our campuses," the Democrat said. "Parents should not have to worry about their students when they send them off to school. And I know that this violence has to stop. ... In the coming days we will take a hard look at all of this to see what we need to do going forward."