President Trump awarded the highest military honor on Wednesday evening to an Army Green Beret who fought his way up a frozen mountain in Afghanistan to help rescue wounded comrades during a mission to kill or capture a terrorist leader.

Master Sgt. Matthew O. Williams, who helped save four critically wounded comrades and prevented the lead element of a special operations force from being overrun in Afghanistan, received the Medal of Honor on Wednesday as he was joined by his wife, Kate, and their 2-year-old son, Nolan.

Williams "put his own life in great peril to save his comrades,” Trump said during the White House ceremony.

“Matt’s incredible heroism helped ensure that not a single American soldier died in the battle of Shok Valley,” he added.

Williams, of Boerne, Texas, previously was awarded the Silver Star for his heroics during the six-hour battle on April 6, 2008, in Afghanistan’s Shok Valley. Williams was part of a joint U.S.-Afghan raid hunting Gulbuddin Hekmatyar, the leader of the former Hezebela Islami Gulbadin militia, Army Times reported.

He was serving as a weapons sergeant with the Special Forces Operational Detachment Alpha 3336 at the time.

TRUMP PRESENTS MEDAL OF HONOR TO FORMER ARMY STAFF SERGEANT WHO RESCUED ENTIRE SQUAD IN IRAQ

“Sergeant Williams’ actions helped save the lives of four critically wounded soldiers and prevented the lead element of the assault force from being overrun by the enemy,” a White House announcement read.

During the raid, Williams and his team, along with Afghan forces, were dropped into the valley by Chinook helicopters. The terrain made it difficult to land the aircraft, so the troops jumped into a cold, waist-deep river.

They had the task of hiking up the mountain to capture Hekmatyar but encountered heavy enemy fire once out of the chopper.

“In the face of rocket-propelled grenade, sniper and machine-gun fire, Sergeant Williams led an Afghan Commando element across a fast-moving, ice-cold and waist-deep river to fight its way up a terraced mountain to the besieged lead element of the assault force,” the statement read. “Sergeant Williams then set up a base of fire that the enemy was not able to overcome.”

When a group of American troops became pinned down and wounded, Williams climbed up the cliff to help conduct a rescue and repair the team's satellite radio. He exposed himself to enemy fire again to move several casualties down the near-vertical mountainside while carrying and loading the wounded into helicopters, officials said.

GREEN BERET TO RECEIVE MEDAL OF HONOR FOR ACTIONS IN 2008 AFGHANISTAN BATTLE

His actions helped save the lives of four critically wounded soldiers and prevented the lead element of the assault force from being overrun, the announcement read.

More than 150 enemy fighters were killed during the raid, according to military officials.

Williams joined the Army in 2005. He deployed to Afghanistan multiple times throughout his military career. The battle was one of the most difficult during his time in Afghanistan, he told Stars and Stripes.

Williams has continued to serve in the Army, assigned to the 3rd Special Forces Group at Fort Bragg, N.C.

“Matt, we salute your unyielding service, your unbreakable resolve and your untiring devotion to our great nation and the nation that we all love,” Trump said before presenting Williams with the Medal of Honor.

He added, “On behalf of the entire nation, our great USA, our incredible Unites States of America, we are forever grateful for your life of service and your outstanding courage.”

Following the ceremony, Williams made a brief statement thanking the Special Forces team who served with him.

Williams was the second member of his detachment to receive the Medal of Honor for the 2008 operation. Former Staff Sgt. Ronald Shurer II received the honor one year ago.

At the beginning of Wednesday's ceremony honoring Williams, Trump mentioned the daring Special Operations forces mission that killed ISIS leader Abu Bakr al-Baghdadi, thanking Defense Secretary Mark Esper and Gen. Mark Milley, the chairman of the Joint Chiefs of Staff.

“We're delighted to have with us the secretary of defense, Esper, and great job to you and everybody, and General Milley for the incredible act you performed seven days ago with al-Baghdadi,” Trump said.

CLICK HERE TO GET THE FOX NEWS APP

“He was hit hard the way he should have been, we are very proud of you.”

He added, “The whole world is proud of you. Thank you, thank you Mark, great job.”

Fox News’ Louis Casiano, Kellianne Jones and The Associated Press contributed to this report.