Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Two U.S. Army Rangers were killed and another wounded during a firefight Wednesday night with ISIS in eastern Afghanistan, two senior U.S. military officials said.

Two of the injured Army Rangers were medevaced and later died of their injuries.

They were identified Friday as Sgt. Joshua Rodgers, 22, of Bloomington, Illinois, and Sgt. Cameron Thomas, 23, of Kettering, Ohio — both assigned to the 75th Ranger Regiment in Fort Benning, Georgia.

Sgt. Joshua P. Rodgers, left, and Sgt. Cameron H. Thomas were killed while conducting combat operations in Nangarhar Province, Afghanistan. U.S. Amry

A bullet grazed the third Ranger and he was expected to make a full recovery, the officials said. Numerous ISIS fighters were also killed.

Troops were conducting an operation with the Afghan National Defense and Security Forces when they came under attack in Nangarhar province, a remote area along the border with Pakistan, Pentagon spokesman Capt. Jeff Davis said Thursday.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The U.S. forces were targeting an ISIS compound that included multiple fighting positions and a tunnel complex, the officials added.

The mission occurred in the Momand Valley — the same place where earlier this month the U.S. dropped the largest non-nuclear weapon ever used — also known as the "mother of all bombs" — to obliterate an ISIS tunnel complex.

ISIS's regional branch for South Asia, known as ISIS-K — for the Khorasan province — calls the region home. The raid Wednesday was targeting one of the highest-ranking ISIS-K leaders in Afghanistan.

A senior U.S. military official told NBC News that the military doesn't know whether or not he was killed. The official said the goal was most likely to capture him.

"The fight against ISIS-K is important for the world, but sadly, it is not without sacrifice," Gen. John Nicholson, the top U.S. commander in Afghanistan, said in a statement.

Afghanistan remains mired in violence and bloodshed as the Taliban and ISIS fight over territory and clash against government and coalition forces.

While military officials say the non-nuclear bomb strike was a tactical one, questions have arisen as to whether the U.S. plans to escalate the war in Afghanistan.

Nicholson has suggested to Congress that the NATO coalition needs several thousand more troops in the country, although neither Defense Secretary Jim Mattis nor President Donald Trump have committed to that publicly. There are some 8,400 U.S. personnel stationed there now to train and advise Afghan forces and support a counterterrorism unit against the various militant networks.

Another American soldier was killed earlier this month while conducting operations against ISIS in Afghanistan as part of the NATO-led Resolute Support mission.

Mattis made an unannounced trip to Afghanistan earlier this week and met with Afghan leaders and U.S. military officials as he hammers out recommendations on America's strategy there.

"We are under no illusions about the challenges associated with this mission," Mattis told reporters.