Jalalabad (Afghanistan) (AFP) - Two US troops were killed and one was wounded while fighting an Islamic State group affiliate in Afghanistan, the US military said Thursday, near where Washington this month dropped the "Mother of All Bombs".

US Forces-Afghanistan said the troops "came under attack during a raid against insurgents in Nangarhar province" late Wednesday.

The troops were working with partnered Afghan soldiers in the raid against IS Khorasan, a local offshoot of the jihadist group based in Iraq and Syria.

"The fight against ISIS-K is important for the world, but sadly, it is not without sacrifice," said US Forces-Afghanistan chief General John Nicholson, using the military's name for IS Khorasan.

In mid-April, the US military earlier dropped the largest non-nuclear bomb it has ever used in combat, hitting IS positions in Nangarhar.

The deployment of the so-called Mother Of All Bombs (MOAB) killed at least 95 jihadists, according to the Afghan defence ministry, but fighting in the area has continued.

"Last night US forces along with some Afghan forces, conducted a night time operation in a village next to Assadkhail village (site of the MOAB)," the governor of Achin district, where the fighting took place, Ismail Shinwari, told AFP.

"They used helicopters to deploy forces and the sound of heavy fighting could be heard from the site. We don't know anything about possible American casualties, but as per our information, up to 40 IS fighters were killed in the operation," he added.

On Thursday evening the Islamic State group claimed on its website to have repelled an attack conducted by American and Afghan forces and to have caused US casualties.

US Forces-Afghanistan did not immediately provide additional information ahead of notification of the dead troops' next of kin.

An American special forces soldier was killed while conducting operations against IS in Nangarhar on April 8.

America has about 8,400 troops in Afghanistan. Most are part of a NATO mission to train and advise Afghan partner forces.

Story continues

But about 2,150 of these troops work in a counterterrorism role and are more likely to be engaged in actual combat.

IS, notorious for its reign of terror in Syria and Iraq, has made inroads into Afghanistan in recent years, attracting disaffected members of the Pakistani and Afghan Taliban as well as Uzbek Islamists.

But the group has steadily lost ground in the face of heavy pressure both from US air strikes and a ground offensive led by Afghan forces.

This week Afghan authorities arrested 35 soldiers who served on an army base in northern Afghanistan where the Taliban staged a deadly attack last week as fears grew they had inside help.

The brutal assault in which 135 recruits were killed is believed to be the deadliest-ever Taliban attack on a military installation.

Afghan forces, already beset by killings and desertions, have been struggling to beat back insurgents since US-led NATO troops ended their combat mission in December 2014.