The FBI released video of shooter Aaron Alexis walking inside Navy Yard with a gun on the day of the shooting. (Thomas LeGro/The Washington Post)

Newly released affidavits and statements by authorities Wednesday reveal puzzling and disturbing details of Aaron Alexis’s life before his murderous rampage at the Navy Yard last week. Alexis, according to the official account, knew that he was going to die before the attack, and he was convinced that someone was trying to manipulate and control him using electromagnetic radiation. He arrived at the Navy Yard on Sept. 16 with a shotgun that he had recently purchased and sawed off at the stock and the barrel, as well as a roll of purple duct tape, a copy of Microsoft Office, and other electronic materials in a backpack.

The information provided by authorities described what happened next:

At 7:53 a.m. on Monday, Sept. 16, Alexis parked his Hertz rental car, a blue Toyota Prius, in Parking Garage 28, across from Building 197. He walked into the building at 8:08 a.m. with a backpack slung over his left shoulder. When he got to the fourth floor, Alexis — carrying the backpack as well as a clipboard — went into a men’s bathroom. He came out carrying a shotgun. . . .

The documents do not detail the shootings, but a haunting 30-second video provided by the FBI shows some of Alexis’s actions. Dressed in a blue striped polo shirt and dark slacks with what appears to be an ID attached to his belt, Alexis stealthily stalks the hallways and a stairwell with his shotgun in hand, ducking behind walls when someone might spot him.

Police received a call reporting an “active shooter” about 8:17 a.m., the FBI said. Officers from Naval District Washington and the Naval Criminal Investigative Service were among the first to confront the gunman, authorities said. At least three D.C. police officers, some armed with only handguns, were inside before heavily armed tactical teams assembled and entered.

The three agents with the NCIS worked in Building 197, where they were assigned to investigate procurement fraud and offer counterintelligence support. Officials said they engaged in two firefights with the gunman in two sections of the sprawling building. Eight additional agents quickly joined them.

Quoting D.C. Police Chief Cathy L. Lanier, [FBI assistant director in charge Valerie] Parlave told reporters that the vast building was a “tactical nightmare” for first responders because of its numerous places for Alexis to take cover and hide.

Officials said it was NCIS agents who pulled a D.C. officer who was shot in the legs to safety and carried him down three flights of stairs and outside. The officer, Scott Williams, a 23-year veteran, was still at MedStar Washington Hospital Center on Wednesday but was expected to make a full recovery. Police also said that a second D.C. officer was hit twice in the chest but that his vest saved him from injury.

The shotgun was found on the first floor of Building 197, near the identification badge that had allowed Alexis access, court papers say.

Near Alexis’s body, authorities said, they found a 9mm semiautomatic pistol — which police have previously said was taken from a security guard he had killed in the first-floor lobby. The documents say the handgun was loaded, even after Alexis’s gunfire exchange in the final battle with police.

Peter Hermann and Ann Marimow

Two of Alexis’s victims, Arthur Daniels and Kenneth Bernard Proctor Sr., were laid to rest this week. See images from Daniels’s funeral in the gallery below.

Hewlett-Packard announced on Wednesday that it was terminating its relationship with the subcontractor that had employed Alexis. The subcontractor, a company called The Experts, protested that Hewlett-Packard’s decision was unfair:

The Experts said in a statement that the decision will affect nearly 250 of its employees.

“The Experts is disappointed in H-P’s decision, as we have continued to meet all of our contractual obligations,” the company said. “The Experts had no greater insight into Alexis’ mental health than H-P, particularly given that an H-P site manager closely supervised him, including during the events in Rhode Island.”

In Rhode Island this year, Alexis called police to report hearing voices and feeling vibrations through his hotel room walls.

Alexis, 34, was hired to help update and replace computer systems at Navy and Marine Corps installations. In recent months, he worked at multiple naval locations, including in North Carolina and Virginia.

The Experts has said it employed Alexis for about six months. The company said it confirmed his secret-level security clearance with the Defense Department after it hired him in September 2012 and again in late June 2013, after Alexis returned from a hiatus. The company has said it hired an outside company to handle two background checks of Alexis.

Marjorie Censer

USIS, the firm that vetted Alexis for the federal government, is under criminal investigation, as federal officials believe it may have misled the government about whether its reviews have been thorough.