Alexis, a former Navy reservist, had been undergoing mental health treatment from Veterans Affairs since August but was not stripped of his security clearance, according to the law enforcement officials, who spoke on condition of anonymity because the criminal investigation was still going on.
He had been suffering a host of serious mental problems, including paranoia and a sleep disorder, and had been hearing voices in his head, the officials said.
The assault is raising more questions about the adequacy of the background checks done on contract employees who hold security clearances - an issue that came up recently with National Security Agency leaker Edward Snowden.
Navy Secretary Ray Mabus ordered two security reviews of how well the Navy protects its bases and how accurately it screens its workers.
Similarly, US President Barack Obama has ordered the White House budget office to examine security standards for government contractors and employees across federal agencies.
In addition, the House and Senate Veterans' Affairs Committees asked the VA for details about any treatment provided to Alexis.
At the US Navy Memorial, in church and on the baseball field, the nation's capital paused to mourn the victims. Hagel laid a wreath at the memorial's "Lone Sailor" statue as taps played.
Just a few blocks from the Navy Yard, the Washington Nationals were back to playing baseball after their Monday night game with the Atlanta Braves was postponed because of the shooting. The Nationals wore blue and gold Navy caps during warm-ups, and a moment of silence was held before the first pitch.
Those killed included: Michael Arnold, 59, a Navy veteran and avid pilot who was building a light airplane at home; Sylvia Frasier, 53, who worked in computer security; Frank Kohler, 50, a former Rotary Club president in Lexington Park, Md., who proudly reigned as "King Oyster" at the annual seafood festival; and marine engineer and naval architect Vishnu Pandit, 61, an Indian immigrant who preferred the nickname Kisan, Hindi for "peasant".
In the Newport, R.I., incident, Alexis told police he got into an argument with someone as he was getting on a flight from Virginia to Rhode Island, where he was working as a naval contractor, and he said the person sent three people to follow and harass him.
He said he heard voices talking to him through a wall while at one hotel, so he changed hotels twice, but the voices followed him, according to the report. He said he feared they might harm him.
He also "stated that the individuals are using 'some sort of microwave machine' to send vibrations through the ceiling, penetrating his body so he cannot fall asleep".
Later that day, Newport police alerted the Rhode Island naval station and sent a copy of the police report, Newport police Lt. William Fitzgerald said Thursday.
A spokeswoman for the station had no comment.
Alexis came to the Washington area about two weeks later and had been staying at hotels. On Saturday, two days before the attack, he went to a Virginia gun store about 24 kilometres from the Navy Yard.
He rented a rifle, bought bullets and took target practice at Sharpshooters Small Arms Range, the store's attorney Michael Slocum said. Alexis then bought a shotgun and 24 shells, according to Slocum.
The FBI said during the attack Alexis was armed with a shotgun. Officials said he also took a handgun from a law officer.
Alexis had run-ins with the law in 2004 and 2010 in Texas and Seattle after he was accused of firing a gun in anger. He was not prosecuted in either case.
And his bouts of insubordination, disorderly conduct and being absent from work without authorisation prompted the Navy to grant him an early - but honourable - discharge in 2011 after nearly four years as a full-time reservist, authorities said.
Alexis joined the Florida-based IT consulting firm The Experts in September 2012, leaving a few months later to return to school. He came back in June to do part-time work at the Washington Navy Yard as a subcontractor, helping the military update computer systems.
The Experts' CEO, Thomas Hoshko, said that Alexis had "no personal issues," and he confirmed that Alexis had been granted a "secret" clearance by the Defence Security Service five years ago.
Alexis's clearance - lower than "top secret" - doesn't need to be renewed for 10 years. Still, the company said it hired outside vendors twice to check Alexis' criminal history.
Alexis' background check "came back clear," Hoshko said.
- AP