The US Navy today ordered a review of security at all of its facilities as questions arose about how a former serviceman with a history of violence and mental illness received clearance to work at a base where he killed 12 people before police shot him dead.

The suspect, Aaron Alexis (34) a Navy contractor from Fort Worth, Texas, entered Washington Navy Yard yesterday morning and opened fire, spreading panic at the base just 2.5 km from the US Capitol and 5 km from the White House.

The company that employed him said today it had enlisted a service to perform two background checks on him over the last year and had twice confirmed his “secret”-level security clearance with the US Defense Department.

“The latest background check and security clearance confirmation were in late June of 2013 and revealed no issues other than one minor traffic violation,” The Experts, an information technology company, said in a statement.

CNN reported that Alexis had contacted two Veterans Administration hospitals recently and was believed to be seeking psychological help.

“It really is hard to believe that someone with a record as checkered as this man could conceivably get, you know, clearance to get ... credentials to be able to get on the base,” Washington DC Mayor Vincent Gray told CNN.

In the wake of the latest mass shooting in the United States and questions about security at guarded buildings, US Navy Secretary Ray Mabus today ordered a review of physical security at all Navy and Marine Corps installations.

A Navy official said authorities would first take a “quick look” at installations to ensure existing physical security standards are being met. The second review will be larger and more in-depth, the official said.

Investigators are still trying to determine the man’s motive for the shooting.

Separately, Congressman Michael Turner asked for Defense Department officials to release information on an inspector general’s audit of its system for controlling civilian workers’ access to military bases.

The Navy may have “implemented an unproven system in order to cut costs,” Turner, an Ohio Republican, said in a letter dated yesterday to Lynne Halbrooks, the Pentagon’s acting inspector general.

“Potentially numerous felons may have been able to gain unrestricted access to several military installations across the country,” said Mr Turner, a member of the House Armed Services Committee.

Military personnel are generally banned from carrying weapons on bases in the United States but most people with proper credentials are not routinely checked for firearms.

Yesterday’s shooting was the worst attack at a base since US.Army Major Nidal Hasan opened fire on unarmed soldiers at Fort Hood, Texas, in 2009, killing 13 people and wounding 31 others. Mr Hasan, who said he acted in retaliation for US wars in Muslim countries, was convicted and sentenced to death by a military jury in August.