A lone gunman with mental health issues was behind a shooting spree at Washington DC's Navy Yard, which left 13 people dead and eight injured, authorities have said.

According to police, military contractor Aaron Alexis, 34, of Texas, launched the attack on Monday inside a building at the navy complex, shooting people in the cafeteria and in a hallway.

Profile: Aaron Alexis

Washington mayor Vincent Gray said on Tuesday there was no evidence that the attacker had an accomplice, "even though we haven't completely ruled that out".

Police chief Cathy Lanier stressed that investigators now felt comfortable that they had the sole person responsible.

'Another mass shooting'

Alexis was an employee of a company called "The Experts", a subcontractor for an HP Enterprise Services military contract, Hewlett-Packard said.

HP said the contract was "to refresh equipment used on the Navy Marine Corps Intranet (NMCI) network". 

The FBI said Alexis used a valid pass to get on the Washington base.

President Barack Obama mourned what he called "yet another mass shooting'' in the US. The Senate was closed, a baseball game postponed and a White House celebration delayed following Monday's shooting.

"It's a shooting that targeted our military and civilian personnel," Obama said. "They were patriots and they know the dangers of serving abroad, but today they face the unimaginable violence that they wouldn't have expected here at home."

Misconduct pattern

Alexis served as a navy reservist from 2007 to early 2011. The FBI released a photograph of Alexis, who held the rank of an Aviation Electrician's Mate 3rd Class and had served full-time in a  logistics support squadron in Forth Worth, according to the Navy.

Al Jazeera's Kimberly Halkett, reporting from Washington, said that Alexis had a troubled past.

"A picture is emerging of someone with a very troubled past and a history of anger management issues," she said.

"He had been treated for mental health issues, including sleeping disorders and paranoia."

Police in Seattle said Alexis was arrested there in 2004 for shooting the tires of another man's car in what he described to detectives as an anger-fueled "blackout''.

Alexis reportedly had expressed an interest in Buddhism, friends told local media in Texas, while his four-year stint in the navy was troubled.

Source: Al Jazeera and agencies