Updated

President Obama joined commanders Wednesday in mourning those who died at Fort Hood, Texas last week, while avoiding condemnation of the fellow soldier who killed them.

"We grieve the tragic loss of four of our own," said Army Chief of Staff Gen. Ray Odierno, pointedly including Spec. Ivan Lopez with the three soldiers he shot to death.

"We must come together to address the risk factors that lead to violence," said Odierno in calling for improvements to mental health services for troubled troops.

Lopez was taking multiple prescription drugs and was under diagnosis for post- traumatic stress when he  used the weapon he bought at a local gunshop to go on a shooting rampage, firing at least 37 times to kill three soldiers and wound 16 others, Fort Hood officials said.

In his eulogy, Obama honored the fallen and echoed Odierno on the commitment to "help and counsel those with mental health issues." Obama also stressed measures "to keep firearms out of the hands of those experiencing difficulties."

The avoidance of condemnation for Lopez contrasted with the scorn for Army Maj. Nidal Hasan at similar Fort Hood ceremonies in 2009. Hasan, a psychiatrist, was convicted of killing 13 and wounding 32 others at Fort Hood. He was sentenced to death by a court martial last summer.

The shootings last week "tear at a wound still raw from five years ago," Obama said. He called on the Fort Hood community to "renew the commitment to keep our troops safe, not just in battle" but when they come home.

Arrayed before the speaker's podium were three sets of combat boots and photographs of those killed by Lopez -- Sgt. 1st Class Danny Ferguson, Staff Sgt. Carols Rodriguez and Sgt. Timothy Owens.

Among them, they had deployed to the war zones of Iraq and Afghanistan a total of nine times, Obama said,.

"That these soldiers lost their lives on American soil at the hands of one of their own makes this tragedy heartbreaking and inexplicable," Odierno said.

Ferguson "died a hero," said Army Lt. Gen. Mark Milley, the top commander at Fort Hood. Ferguson "held a door closed to protect a room full of other soldiers" while Lopez fired repeatedly outside, Milley said.

Milley also praised the heroism of the female military police officer who confronted Lopez at close range and fired a shot that missed. Lopez then killed himself with a shot to the head.

"Many would've taken a step back -- she took a step forward," Milley said of the officer.

The ceremony came as the military grappled with yet another shooting on base that took the life of a Marine at Camp Lejeune, N.C.

"It appears right now to have been an accident," Pentagon spokesman Col. Steve Warren said of the shooting Tuesday evening at the main gate of Lejeune.

The initial investigation pointed to a "negligent discharge" of an M-4 carbine that killed a Marine on guard duty with a shot to the chest, a Marine spokesman said. The Marine who fired the M-4 was taken into custody. His name and the name of the victim were not immediately disclosed.

-- Richard Sisk can be reached at richard.sisk@monster.com