Image copyright US Army Image caption Sgt Joshua Rodgers (L) and Sgt Cameron Thomas were killed in Nangarhar Province, Afghanistan

Two US Army Rangers killed in Afghanistan this week may have been hit by friendly fire, the Pentagon says.

The soldiers were fatally wounded during a firefight on Wednesday night with the Islamic State (IS) group in eastern Afghanistan, US officials said.

The two were identified on Friday as Sgt Joshua Rodgers, 22, and Sgt Cameron Thomas, 23, who were both on their third deployment to Afghanistan.

A bullet grazed a third Ranger but he was expected to make a full recovery.

US Forces in Afghanistan said in a statement: "USFOR-A is investigating the possibility that the two Rangers were accidentally killed by friendly fire during the more than three-hour fight.

"We have informed both of their families of this possibility and we have appointed a team to investigate the soldiers' deaths."

Sgt Rodgers, of Bloomington, Illinois, was a Ranger team leader. Sgt Thomas, of Kettering, Ohio, was an anti-armour specialist.

Both were assigned to the 75th Ranger Regiment in Fort Benning, Georgia.

They were on a mission with Afghan security forces when they came under attack in remote Nangarhar province, near the border with Pakistan.

The operation took place in the Mamand Valley, where the US earlier this month dropped the largest non-nuclear munition ever used - known as the mother of all bombs - to destroy an IS tunnel network.

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

Media playback is unsupported on your device Media caption The moment MOAB bomb struck IS cave and tunnel systems

According to the Pentagon, the target of the raid was Abdul Hasib, leader of "ISIS-K", as the US military calls the militant group's Afghan affiliate.

The operation began at about 22:30 (18:00 GMT) local time on Wednesday, the US defence department said.

Two platoons of Army Rangers along with the same number of Afghan forces were dropped off by helicopter near the IS base.

"Within a few minutes of landing, our combined force came under intense fire from multiple directions and well-prepared fighting positions," said the Pentagon.

"Nevertheless, our forces successfully closed on the enemy, killed several high-level ISIS-K leaders and upwards of 35 fighters.

"If confirmed, the death of the Emir and his associates will significantly degrade ISIS-K operations in Afghanistan and help reach our goal of destroying them in 2017."

The fighting was at "close-quarters from multiple compounds" and US air strikes were carried out.

The Pentagon said it had heard no indication of civilian casualties, praising the actions of the US and Afghan forces as "exemplary".

"In the most difficult terrain and under complex circumstances, they were able to accomplish their mission while protecting the women and children in the compound," said the statement.