ERBIL, Iraq (Reuters) - New details from a U.S. military investigation into Navy Chief Petty Officer Jason Finan’s death in Iraq are illustrating the twin risks of a bomb-ridden battlefield and shifting front lines in the campaign to retake the city of Mosul from Islamic State.

Finan on Thursday became the first U.S. military casualty in Iraq’s offensive to capture the city of 1.5 million people, a highly complex operation that is expected to become the biggest battle fought in Iraq since the 2003 U.S.-led invasion.

At the time Finan was killed, he was helping troops avoid a roadside bomb he identified while they tried to reposition further back from the fighting -- a precaution as Islamic State advanced toward Iraqi forces, a top general said on Sunday, disclosing new information about the incident.

“(Islamic State) started pressing toward the (Iraqi military’s) position,” said Army Lieutenant General Stephen Townsend, the top U.S. commander in Iraq.

“These guys said, you know what, we probably need to move back a terrain feature and gain a little bit more standoff and they were in the process of that when they struck an (roadside bomb).”

Finan, 34, was attached to a Navy SEAL force that was supporting the Iraqi military’s elite counter-terrorism service, some distance back from the front line, a U.S. defense official said, speaking on condition of anonymity.

U.S. strategy in Iraq is to advise Iraqi forces but not at the very front line of fighting, U.S. officials say. About 5,000 U.S. troops are in Iraq and between 100 and 200 U.S. forces are so far embedded with Iraqi and Kurdish troops battling to recapture Mosul, they say.

The fighting is now focused on villages outside Mosul.

Townsend suggested Finan may have also helped save the lives of those around him. A bomb expert in the Navy, Finan found a so-called improvised explosive device, or IED, in the area.

“He had seen an IED and warned his teammates and was directing everyone to safety when he struck an IED that eventually killed him,” Townsend said.

The incident was a reminder of the risks ahead in the Mosul campaign. Recapturing the city would signal a pivotal defeat for the ultra-hardline Sunni jihadists in Iraq. Still, U.S. military leaders warn Islamic State will likely morph into a more classic insurgency.

U.S. Defense Secretary Ash Carter, who met one of Finan’s teammates in Baghdad over the weekend, said Finan’s death showed how U.S. forces still faced considerable risk -- even though they weren’t being sent to lead the charge in Iraq’s ground campaign.

“He was doing risky work but he was doing absolutely necessary work,” Carter said.