In a statement announcing the interventions, the White House praised the military justice system for instilling discipline in the armed forces.
"The president, as commander-in-chief, is ultimately responsible for ensuring that the law is enforced and when appropriate, that mercy is granted," the statement read. "For more than two hundred years, presidents have used their authority to offer second chances to deserving individuals, including those in uniform who have served our country.
"These actions are in keeping with this long history. As the president has stated, 'when our soldiers have to fight for our country, I want to give them the confidence to fight.'"
Trump signed an executive grant of clemency for Army First Lt. Clint Lorance, who has served six years of a 19-year prison sentence for a 2013 second-degree murder conviction for ordering soldiers to fire on three Afghan men who were riding toward the service members on a motorcycle. Two of the Afghan men died.
"Under difficult circumstances and prioritizing the lives of American troops, Lorance ordered his men to engage," the White House said.
The president also signed an executive grant of clemency for Army Maj. Mathew Golsteyn, who was awaiting a murder trial for admitting to killing a Taliban bomb maker.
In addition to the pardons, Trump restored Special Warfare Operator First Class Edward Gallagher to grade E-7, the rank he held before he was tried and convicted of posing with the corpse of an Islamic State militant. Gallagher also was acquitted of murder.
Anonymous military officials told CNN and The Washington Post that Pentagon officials, including Defense Secretary Mark Esper, discouraged Trump from issuing the pardons. The officials said the action could prevent the Pentagon from prosecuting other people involved in the cases and could threaten the integrity of the military justice system.