Twelve people were killed and several others injured after a shooter opened fire on Friday at the Virginia Beach Municipal Center in Virginia, officials said.

Responding officers shot the suspect, a longtime city engineer named DeWayne Craddock, who also later died, Virginia Beach police Chief James A. Cervera said. The suspect entered the building Friday afternoon with his security pass, like any other employee.

All of those killed were city employees except for one person, a contractor, who was at the municipal center to get a permit, Cervara said. A public vigil will be held Tuesday at 6 p.m. at a church in Virginia Beach.

The victims were found on three different office floors, the chief said. "It's a horrific crime scene," he said Saturday morning at a press conference.

From top left, Laquita C. Brown, Tara Welch Gallagher, Mary Louise Gayle, Alexander Mikhail Gusev, Richard H. Nettleton, Christopher Kelly Rapp, Katherine A. Nixon, Ryan Keith Cox, Michelle Langer, Joshua A. Hardy, Robert Williams, and Herbert Snelling. Photos provided by City of Virginia Beach

Among the five people who were injured was an officer who was shot by the man and was expected to recover, authorities said.

"He was saved by his vest," the police chief said, later adding: "He was attended to at the scene" before being transported to a hospital.

Four of the injured remained hospitalized Saturday, Cervera said. Three of them are in critical condition, two of them at Sentara Virginia Beach General Hospital and one at Sentara Norfolk General Hospital, the president of Sentara Healthcare said Saturday in a statement. A fourth person is in fair condition at the Virginia Beach hospital.

The hospital president, Howard Kern, added that two "Sentara team members lost loved ones" in the shooting.

Virginia Beach's emergency services chief in a Facebook post on Saturday praised the community's first responders.

"We treated and transported multiple victims in rapid succession. Our tactical medics operated inside the building under harrowing conditions, EMS Chief Edward Brazle wrote.

The suspect, who had worked for the city for about 15 years as an engineer recently purchased multiple firearms legally, a federal official told NBC News. Cervera said the shooter used a semiautomatic handgun and had multiple extended magazines. He also had a suppressor that muffles the sound of gunfire.

Investigators recovered additional weapons at the scene and at the suspect's home, Cervera said.

Authorities said at a news conference Saturday afternoon that the suspect lived alone but did not offer much other information about him. The Associated Press reported that he was 40 years old.

Police have declined to discuss a possible motive yet.

Mayor Bobby Dyer said, "This is the most devastating day in the history of Virginia Beach."

Officials initially said 11 victims were killed by the shooter but a 12th victim died later either en route or at a hospital, Cervera said.

He said four officers initially responded, and "I can tell you it was a long gun battle between those four officers and that suspect."

Authorities identified the deceased victims Saturday as City of Virginia Beach employees: Katherine A. Nixon, Richard H. Nettleton, Laquita C. Brown, Tara Welch Gallagher, Alexander Mikhail Gusev, Christopher Kelly Rapp, Ryan Keith Cox, Joshua O. Hardy, Michelle "Missy" Langer and Robert "Bobby" Williams.

Download the NBC News app for breaking news

Herbert "Bert" Snelling, a contractor, was also killed in the shooting, authorities said.

Meghan Banton, a city utility worker, told NBC News affiliate WAVY, "We just heard people yelling and screaming to get down. I was on the phone with 911."

The shooting occurred in a building that houses public works, public utilities, communications and other departments.

President Trump and House Speaker Nancy Pelosi each commented on the massacre Saturday morning.

The president tweeted that he had called the Virginia governor and the mayor and vice mayor of Virginia Beach to offer condolences. "The Federal Government is there, and will be, for whatever they may need," Trump wrote.

Pelosi, a California Democrat, said in a statement, “The American people share the grief of the entire Virginia Beach community." She called on the U.S. Senate to bring to a vote "commonsense, bipartisan gun violence prevention legislation" that has been passed by the House.

Virginia Gov. Ralph Northam told reporters Friday evening, "Our thoughts are for these victims and their families. And we're one with our law enforcement, our first responders, the hospital, and making sure that we're taking care of everybody right now."

Native son Pharrell Williams tweeted, "We are praying for our city, the lives that were lost, their families and everyone affected. We are resilient.We will not only get through this but we’ll come out of this stronger than before we always do."