An Army soldier from Tucson has died from wounds he suffered in an attack this month in Afghanistan, officials said today.

Command Sgt. Maj. Martin R. Barreras, 49, of Tucson, died Tuesday at San Antonio Military Medical Center. Barreras was wounded May 6, in Harat Province, Afghanistan, when his unit was attacked with small arms fire, according to the Department of Defense.

Barreras was assigned to the 2nd Battalion, 5th Infantry, 3rd Brigade Combat Team, 1st Armored Division at Fort Bliss in El Paso.

He graduated from Sunnyside High School prior to joining the military, according to a news release issued by the fort.

He served in the Marine Corps prior to enlisting in the Army, the release said. He served combat tours in Iraq and Afghanistan. He also served in U.S. military operations in Panama and in Haiti. Barreras served 22 years as an Army Ranger. He also served three years with the Army's Marksmanship Unit.

In March 2013, Barreras was assigned as the senior enlisted advisor for the 2nd Battalion, 5th Infantry Regiment at Fort Bliss.

“Command Sergeant Major Barreras was my friend and battle buddy,” said Lt. Col. Edward Brady, the 2nd Battalion, 5th Infantry Regiment commanding officer. “I’ve spent more time with him than my wife since I’ve taken command. I believe that I was the luckiest battalion commander in the Army to have him as my (Command Sergeant Major)."

Barreras is survived by a wife, two daughters and a son, the post said.