FORT HOOD, Texas - A US soldier with mental health issues shot dead three people and injured at least 16 on Wednesday before taking his own life at an Army base in Fort Hood, Texas, the site of another deadly rampage in 2009, US military officials said.The soldier, who was being treated for depression and anxiety, went to two buildings on the base and opened fire before he was confronted by military police, Fort Hood commanding officer Mark Milley said.The gunman, whose motive remains unknown, then shot himself in the head with a .45-caliber pistol, he added."The shooter is dead from a self-inflicted gunshot wound," Milley told a news conference. "At this time there is no indication that this incident is related to terrorism." Security officials said preliminary information identified the gunman as Ivan Lopez but Milley declined to identify the shooter, who is married, until his family was notified.The shooter had served for four months in Iraq in 2011, Milley said, and was also undergoing a diagnosis for post traumatic stress disorder.The Scott & White Hospital in Temple, Texas, where some of the wounded were taken, said nine patients were in intensive care, three in critical condition.US President Barack Obama said he was "heartbroken" that another shooting had occurred at the Fort Hood Army base."We are going to get to the bottom of exactly what happened," Obama said. "We're heartbroken that something like this might have happened again." The shooting, the third such incident at a military base in the United States in about six months, started at about 4 p.m. local time (2100 GMT) and put Fort Hood on immediate lockdown.Milley said the shooter walked into one of the unit buildings, opened fire, then got into a vehicle and fired from there. He then went into another building and opened fire again, until he was engaged by Fort Hood law enforcement.When confronted by a female military police officer, he killed himself with his semi-automatic weapon in the parking lot."He was approaching her at about 20 feet. He put his hands up, then reached under his jacket, pulled out the (.45) and she pulled out her weapon and then she engaged, and he then he put the weapon to his head," Milley said.One of the buildings housed medical brigade day-to-day operations and the other, nearby, served the administration of the transportation battalion. All the killed and wounded were military personnel.As soon as the shooting broke out, police secured the base perimeter, emergency vehicles rushed to the scene, helicopters circled Fort Hood and officers went from building to building searching for the shooter."We're camping out. ...The only guidance we've been given is to hunker down," a Fort Hood soldier who answered the phone at a building near the shooting told the Austin American-Statesman.Central Texas College ordered an immediate evacuation of all students and staff and canceled classes at its Fort Hood campus."It's a terrible tragedy. We know that. We know there are casualties, both people killed and injured," Defense Secretary Chuck Hagel said.VIOLENCE REPEATED The violence echoed the rampage of 2009, when a former Army psychiatrist shot dead 13 people and wounded 32 others in a shooting spree at Fort Hood, a base from where soldiers prepare to deploy to Iraq and Afghanistan.Major Nidal Hasan shouted "Allahu Akbar," or "God is greatest" in Arabic, during the attack and later said he wanted to be a martyr. He was convicted and faces death by lethal injection.In February, the US military demolished the building where Hasan went on a shooting spree. It will plant trees, install a gazebo and mark the site with a remembrance plaque for the victims, the base said.In September, a gunman opened fire at the Washington Navy Yard, killing 12 and wounding four before being slain by police. Last month, a civilian shot dead a sailor aboard a ship at a US Navy base in Norfolk, Virginia.Hagel, pressed about the military's so-far frustrated effort to secure its bases from potential shooters, said the latest incident at Fort Hood showed that there were problems that still needed to be addressed. The latest tragedy shows something is not working and needs to be fixed, he said.Just last month, he ordered steps to improve Pentagon security after reviews found the Navy Yard shooting could have been averted if the gunman's mental health had been properly handled.