An off-duty, 31-year-old Massachusetts state trooper died Wednesday after suffering a medical emergency while performing physical training, according to David Procopio, state police spokesman.

Framingham first responders and medical personnel at MetroWest Medical Center in Framingham tried "valiantly to save his life," Procopio said in a press statement.

The trooper, whose identity is being withheld, worked out of the Framingham barracks in the Division of Field Services. A veteran of the U.S. Air Force, he graduated in 2011 as a member of the 80th Recruit Training Troop.

"The state police express our gratitude to the Framingham Police officers, firefighters and ambulance personnel who responded to the trooper's medical emergency, and to the emergency room staff at Framingham Union Hospital," the department said.

The incident occurred on "a local street" on Wednesday afternoon. Further details were not immediately available.

The trooper leaves behind a wife, father, sister and in-laws.

"Most of all, our thoughts at this time, and our prayers, are with his family," Procopio said.

Funeral services will be announced in the coming days, he said.