The medal went to Sgt. 1st Class Alvaro Barrientos, who was wounded in action on March 17 in Afghanistan during what is now America’s longest war.

President Donald Trump awarded a Purple Heart to an Army sergeant recently wounded in Afghanistan, the first of many Trump likely will award during his service as commander in chief of the US military.

“When I heard about this ... I wanted to do it myself,” Mr. Trump said on Saturday during a brief ceremony at Walter Reed National Military Medical Center in Bethesda, Maryland, outside Washington.

The medal went to Sgt. 1st Class Alvaro Barrientos, who was wounded in action on March 17 in Afghanistan during what is now America’s longest war.

The White House did not release Barrientos’ hometown.

“Congratulations on behalf of Melania and myself and the entire nation. Tremendous,” said Mr. Trump, mentioning his wife.

It was Mr. Trump’s first visit as President to the military hospital.

Mr. Barrientos, whose right leg below the knee had been amputated, was brought into a hospital atrium in a wheelchair, accompanied by his wife, Tammy.

Mr. Trump kissed Mr. Barrientos’ wife before pinning the medal on the sergeant’s left shirt collar, grasping Mr. Barrientos by the shoulders and then shaking his hand.

The Purple Heart is awarded to service members who are wounded or killed in action.

Besides Mr. Barrientos, Mr. Trump met privately with about a dozen service members who are receiving care at the medical center.

Before leaving the White House, the President tweeted that he looked forward to “seeing our bravest and greatest Americans.”

Mr. Trump’s decision to allow news media coverage of the medal ceremony was in sharp contrast to former President Barack Obama, who awarded Purple Heart medals during his own regular visits to Walter Reed but always did so behind closed doors.

Mr. Trump was driven to Maryland instead of flying in the Marine One helicopter, the way presidents typically travel to Walter Reed, due to annual public tours of the White House south grounds and gardens that were taking place on Saturday.

As the motorcade exited the complex, nearby sidewalks were lined with people who had come to Washington on Saturday, which is also Earth Day, to promote science and defend it from attack, including Mr. Trump’s proposed budget cuts.

Some held signs that said “Support Science” and “Science Saves Lives.”

Later that evening, Mr. Trump and the first lady went to dinner at Trump’s hotel near the White House. It’s a favorite dining spot for Mr. Trump when he ventures outside the executive mansion.