Image caption The two men were killed in the same province where the US dropped a huge bomb that flattened houses and trees

Two Americans were killed and a third was wounded in a raid in Afghanistan against Islamic State group militants, the Pentagon has confirmed.

The military personnel died in combat in Nangarhar province, said Pentagon spokesman Capt Jeff Davis.

Earlier this month American Army Staff Sgt Mark De Alencar, 37, was killed in the same province.

It comes only days after US Defense Secretary Jim Mattis visited the country.

The American soldiers were conducting an operation against IS Khorasan, an affiliate of the core Middle Eastern group.

The operation was conducted in partnership with the Afghan National Defense and Security Forces, the Pentagon said.

"The fight against ISIS-K is important for the world, but sadly, it is not without sacrifice," said General John Nicholson, the commander of US forces in Afghanistan.

"On behalf of all US forces and our coalition partners, I offer our deepest sympathies to the families, friends, and fellow service members of our fallen comrades," he continued.

Next of kin have been notified, but their names are being temporarily withheld from the media, the Defence Department said.

The operation took place near the district of Achin, near to where the US recently dropped "the mother of all bombs", the largest non-nuclear weapon in the US arsenal.

The Mother of All Bombs: How badly did it hurt IS in Afghanistan?

Media playback is unsupported on your device Media caption The BBC's Auliya Atrafi found fighting continues close to where the MOAB hit

A spokesman for the Nangarhar governor told Reuters that about 40 IS fighters were killed in the raid, and another 13 were captured alive.

Estimates for how many IS fighters are in Afghanistan vary.

US officials believe about 700 fighters occupy the Nangarhar and neighbouring Kunar province.

But Afghan officials estimate that there are closer to 1,500 militants.