One of two brothers who died while serving in Iraq and Afghanistan committed suicide, family and military officials said Thursday.

Army Spc. Andrew Velez, 22, died last month in Afghanistan, a little more than a year after his older brother, Cpl. Jose "Freddy" Velez, 23, was killed in Iraq. They are the first brothers to die in the two conflicts, the military said.

A military document, confirmed by the family, says Velez shot himself with a mini-machine gun July 25. Military officials and the soldier's father said Velez had been having marital problems.

Roy Velez said his grief keeps him up at night.

"It's not easy to sleep," he said. But "I'm proud of my sons. I miss them, but it was to defend their country, their God. They volunteered to go."

Veronica Velez declined to comment Thursday. She and Velez have three children together, ages 2, 3 and 5.

Velez joined the Army shortly after graduating from high school in 2002. He escorted his older brother's body back from Iraq in 2004 after Freddy Velez was killed when his unit came under fire in Fallujah. Despite the loss, Velez signed on for another six years in the military in March, his father said.

Freddy Velez joined the Army in 2000 after graduating from high school. He was deployed to Iraq in March 2003.

A memorial service for Andrew Velez was planned for Thursday evening.