Defense Secretary Chuck Hagel intends to order a security review at all U.S. military bases worldwide, a senior Pentagon official said Tuesday, a day after a contract worker — who had obtained a security clearance despite a history of violent behavior — killed 12 people in a shooting rampage at the Washington Navy Yard.

Navy veteran Aaron Alexis, 34, was killed by police bullets on Monday morning, ending the deadliest day in the Washington region since the terrorist attacks of 2001. Several other people were wounded in the shootings, including a veteran D.C. police officer who was shot in both legs.

On Tuesday, new details emerged that showed Alexis had received treatment for mental illness, and that he had called police a month ago to report hearing voices.

Two law-enforcement sources said Alexis had received treatment from the Department of Veterans Affairs at some point in the past because of the voices he said he was hearing.

Authorities also began to piece together how Alexis, who came to the Navy Yard carrying a shotgun he had bought in Northern Virginia two days before, caused so much bloodshed in a short period of time.

Read eyewitness accounts from the Navy Yard shooting.

Authorities said Alexis, who had entered the base with a valid pass, used a key card to gain legitimate access to Building 197, a large building that houses Navy offices.

Officials said Alexis fired with his shotgun from the fourth floor, working his way down to the third floor and then to the lobby. At some point, he confronted and killed a security guard, then took the guard’s 9mm handgun, believed to be a Beretta, law enforcement authorities said.

Outside, police officers began to arrive. Authorities said the first officers were at the Navy Yard gate within two minutes of the first call to 911.

Within four to six minutes, they were inside the complex. Within seven minutes, D.C. police officers were outside Building 197. They heard gunshots,and moved inside, accompanied by members of the Naval Criminal Investigative Service.

Authorities said the officers went room to room and had what were described as “multiple engagements” with the shooter that lasted more than 30 minutes before the final firefight.

“They saved numerous lives by engaging the way they did,” D.C. Police Chief Cathy L. Lanier said.

In the confusion, Alexis moved back upstairs to a higher floor.

There, he was eventually shot several times in the head by a by a D.C. police officer who is a member of the Emergency Response Team, the department’s SWAT unit.

Among the details that remained unclear Tuesday was when the wounded D.C. officer — 23-year veteran Scott Williams — was shot. Two sources familiar with the investigation said he was hit by a single bullet that passed through one leg and hit the other, shattering bones in both. He underwent surgery to insert pins, and doctors are trying to save the use of his legs. Lanier described him as being in good spirits and predicted he would walk again.

Several sources said two other officers pulled Williams, who was with two colleagues on the Special Operations Division K9 team, to safety.

On Monday, D.C. police had been worried about a second and even a possible third shooter, with indications that a weapon believed to have been used was missing. Police later said they were satisfied that one shooter was responsible. One white male whom police had been looking for turned out to be a Navy member who had joined first responders after being issued a weapon.

A statement from D.C. police said all 12 of the employees who died were shot by Alexis inside the building, “while in the lobby, and on the third and fourth floors.” Information obtained by The Washington Post shows that the one victim who died at a hospital, Vishnu “Kisan” Pandit, a 61-year-old civilian who worked for the Navy, was pronounced dead at George Washington University Hospital at 9:07 a.m. All the rest of the victims were pronounced dead in Building 197, a document shows, starting at 3:26 p.m. The final body to be pronounced was that of the shooter, at 8:48 p.m.

The tactics used by police on Monday reflected a broader change in American policing in the years since the 1999 massacre at Columbine High School — as the words “active shooter” entered the national vocabulary.

Until that shooting in Colorado, the first responding officers would set up a perimeter and call in tactical officers, or members of SWAT. J. Pete Blair, director of research for the Advanced Law Enforcement Rapid Response Training, based at Texas State University, said that model proved fatal.

It can typically take at least 30 minutes for such teams to assemble and plan, Blair said, and at Columbine, “the shooter had free access to the school and could hunt down kids and kill them. There was a lot of public outcry and soul searching on behalf of the police.”

On Monday, police used more aggressive tactics, forming “active shooter teams” and going in quickly. The entire episode, from first shots to Alexis’s death, took between a half-hour and an hour, said Lanier, the D.C. police chief.

Police in Newport, R.I., said Tuesday that Alexis had called them last month from a hotel room there, complaining that he heard voices that followed him from hotel to hotel. Alexis also said that someone was using a “microwave machine” to sent vibrations through the ceiling, preventing him from sleeping, police said.

Alexis “stated that he has never felt anything like this and is worried that these individuals are going to harm him,” the report said. Police did not see a cause to arrest Alexis.

In Lorton, Va., a gun shop said that Alexis had purchased a Remington 870 shotgun and about two boxes of shells on Saturday, two days before the rampage. J. Michael Slocum, a lawyer for Sharpshooters Small Arms Range and gun shop in Lorton, said the shop ran a background check on Alexis through the federal database called the National Criminal Information Background Check System. Alexis was approved.

Alexis entered the Navy Yard with a valid pass, obtained through his work as a contractor, authorities said Tuesday afternoon. He was carrying a shotgun. Alexis may also have obtained a handgun during the rampage, authorities said.

Valerie Parlave, head of the FBI’s Washington field office, said Alexis was not carrying an AR-15 assault rifle when he arrived, as had been previously reported by some news media.

On Tuesday — as streets around the Navy Yard reopened and police released the names of the 12 deadnew details also emerged about Alexis’s life. It appeared, in these early hours of the investigation, that he had repeatedly run afoul of both police and his superiors in the Navy.

But, time after time, Alexis seemed to escape the worst potential consequences of his alleged actions. Charges were dropped. The Navy allowed him to leave with an “honorable” discharge, even after a history of misconduct.

And Alexis wound up with a job in information technology, a “secret” government security clearance and a shotgun.

The military’s first job would be to unravel the last apparent failure, in a long chain of them. How did Alexis get onto the tightly guarded base with a gun?

The review ordered by Hagel would examine the physical security of military bases, as opposed to the granting of security clearances to individuals. Hagel’s order came after a similar order issued by Navy Secretary Ray Mabus to examine security procedures at Navy and Marine Corps installations in the United States

Navy officials said their first review would be a quick assessment of current “physical” security procedures, including how visitors are searched at base entrances. A second, longer review would look at access to those bases and whether new regulations might be required.

Neither of those reviews would look at the procedures involved in granting security clearances to contract workers like Alexis, Navy officials said.

Alexis’s employer questioned Tuesday how he could have been granted a “secret”-level security clearance by the government. Thomas Hoshko, chief executive officer of The Experts, said he was disturbed upon seeing media reports about incidents, investigated by police, in which Alexis shot out tires on a construction worker’s car in 2004 and fired through the ceiling of his Fort Worth apartment in 2010, barely missing his upstairs neighbor.

“If I can find this out just by doing a Google search, that is sad,” Hoshko said. “Anything that suggest criminal problems or mental health issues, that would be a flag. We would not have hired him.”

[Click here for the latest updates on the Washington Navy Yard shootings.]

On Tuesday morning, essential personnel were allowed to return to their offices inside the Navy Yard, a historic base that is home to several major commands and Navy offices and employs about 16,000 military and civilian personnel.

“It’s surreal,” said Cmdr. Andrew House, 46, a Navy lawyer who was headed to his office in the early morning sunshine. “I think one of the important things to do is go back and do the work of the Navy — not let one person stop us from doing that. We need to do the work of the Navy.”

Two miles north, on Pennsylvania Avenue NW, a wreath was placed near the symbolic statue of the Lone Sailor at the Navy Memorial at 10 a.m. The sculpture represents all of the people who have served in the Navy or other sea services. Defense Secretary Chuck Hagel attended the ceremony.

Police also released all the names of the dead — many of them workers whose offices were behind high walls and armed guards, seemingly in one of the safest corners of federal Washington.

They were not safe. The dead were found in the building’s lobby, police said, and on the third and fourth floors.

Those killed in the rampage were: Michael Arnold, 59; Martin Bodrog, 54; Arthur Daniels, 51; Sylvia Frasier, 53; Kathleen Gaarde, 62; John Roger Johnson, 73; Mary Knight, 51; Frank Kohler, 50; Vishnu Pandit, 61; Kenneth Bernard Proctor, 46; Gerald L. Read, 58; and Richard Michael Ridgell, 52.

Alexis left Texas about a year ago. Authorities made a public appeal Monday for help in tracing his movements since then.

Parlave said he had been in the Washington area since about Aug. 25 and had stayed most recently at a Residence Inn in Southwest Washington. That stay began on Sept. 7.

“We don’t know what the motive is,” said D.C. Mayor Vincent C. Gray (D), who added that there was no reason to suspect terrorism.

Navy officials said that they did not have information about Alexis’s medical history or whether he was ever treated for mental illness. In both the House and Senate, committees have asked the Department of Veterans Affairs for any information on mental health treatment provided to Alexis. That department has not confirmed that Alexis received any treatment for mental health problems.

But, according to a police report, Alexis told Seattle police that he had experienced a “black-out” fueled by anger in 2004, when he allegedly shot out the tires of a construction worker’s car. Alexis also said he had been at the site of the Sept. 11, 2001, terrorist attacks, and that “those events had disturbed him,” according to the police report.

The Navy on Tuesday corrected its initial account of the circumstances under which Alexis left the service. He received an honorable discharge, effective Jan. 31, 2011, a Navy official said. On Monday, the Navy mistakenly said that Alexis had received a general discharge, a less-desirable category that would have indicated to future employers that there was something amiss with his performance.

The official clarified that the service had originally sought to kick out Alexis with a general discharge because of his pattern of misconduct while in uniform, in addition to his arrest by Texas authorities in 2010 for shooting a gun into his neighbor’s apartment. But those proceedings were moving slowly, and it was unclear whether the Navy had sufficient cause to approve a general discharge, the official said.

As a result, when Alexis applied on his own to leave the Navy in early 2011 with an honorable discharge, the service granted his request, the official said.

Carol D. Leonnig, Clarence Williams, Jennifer Jenkins, Sari Horwitz, Ann Marimow and Ashley Halsey III contributed to this report.