Army First Lt. Clint Lorance on Friday changed out of the drab inmate’s uniform he had worn for six years, and left the military prison at Fort Leavenworth in Kansas a free man. He arrived minutes later at a nearby hotel, where his family swallowed him in a group embrace, crying tears of joy.

“I want to say thank you to President Trump,” he said amid a throng of well-wishers. “And I want the rest of the country to do that, too.”

The president on Friday cleared Lieutenant Lorance and two other servicemen accused or convicted of war crimes, drawing cheers from thousands of supporters who said the men had been unfairly punished for decisions made in the confusion of war.

But many in the military, especially in military legal circles, are not celebrating. Mr. Trump’s reprieves, issued against the advice of top defense officials, were seen as a sign of disregard not only for the decisions of military juries, but for the judicial process itself.