U.S. Defense Secretary Ashton B. Carter announced that a member of the U.S. armed forces died by "enemy fire" in northern Iraq on May 3, 2016. This is the third U.S. combat death in the country during the campaign against the Islamic State. (Reuters)

U.S. Defense Secretary Ashton B. Carter announced that a member of the U.S. armed forces died by "enemy fire" in northern Iraq on May 3, 2016. This is the third U.S. combat death in the country during the campaign against the Islamic State. (Reuters)

An elite U.S. Navy SEAL was killed Tuesday in an attack by Islamic State fighters in northern Iraq, highlighting the evolving nature of the Pentagon’s mission in Iraq and how American troops are serving closer than ever to the front lines.

The SEAL was killed by enemy fire about 9:30 a.m., U.S. military officials said, speaking on the condition of anonymity because they were not authorized to release information publicly.

Arizona Gov. Doug Ducey (R) identified the slain SEAL as Charlie Keating IV. He was the grandson of Arizona financier Charles Keating, who was convicted in the savings-and-loan scandal of the 1980s and 1990s.

[U.S. troops are getting closer to the fight against the Islamic State in Iraq]

The death occurred after Islamic State fighters north of Mosul penetrated a front line of Kurdish peshmerga forces by about three miles, a U.S. military official said.

In this 2002 photo, Charlie Keating IV, 16, poses for in Phoenix for an upcoming series on the Discovery channel that he took part in. Keating was identified as the Navy SEAL killed on May 3 in Iraq. (Sherrie Buzby/The Arizona Republic via AP)

The SEAL was the third U.S. service member killed in combat since the U.S. military campaign against the Islamic State began in June 2014.

The first, Army Master Sgt. Joshua L. Wheeler, 39, was a member of the elite Delta Force who was killed in a raid on an Islamic State prison compound Oct. 22. But the latest two deaths show the kind of threats faced by the bulk of U.S. troops advising Iraqi soldiers near the front lines with the Islamic State.

The death occurred after Islamic State fighters began attacking peshmerga lines at dawn near the town of Teleskof, about 20 miles north of Mosul, the Islamic State’s main stronghold in Iraq, Kurdish officers said.

The attack involved “truck bombs supported by infantry,” the U.S. military official added, an indication that conventional Islamic State tactics were used..

An established front line — what U.S. service members call a forward line of troops, or FLOT — has separated the Islamic State and Iraqi soldiers for months, and the Islamic State often tries to breach it using vehicles carrying explosives, with infantry-type fighters following.

[Shiite pilgrims in Islamic State crosshairs]

Mortar rounds and artillery began hitting front lines near Teleskof, a largely Christian town, about 4 a.m., according to Kurdish officers and members of the Assyrian Christian militia that hold the ground there.

Its inhabitants, speakers of ancient Aramaic, fled in August 2014 when the town was overrun by Islamic State forces, who burned and desecrated its churches. It was retaken by Kurdish forces the same month, and some residents had since returned.

But after bombarding the area Tuesday, the militants launched a multi-pronged attack on Teleskof about 5:30 a.m. from several directions, using hundreds of fighters, commanders said.

Maj. Gen. Azad Jalil, a peshmerga officer, said Islamic State forces breached Kurdish front lines with more than 10 car bombs, also using bulldozers to push through.

The peshmerga then made a “tactical retreat” to reorganize their forces, he said. Islamic State militants overran the town.

Brig. Gen. Bahnam Aboush, a fighter with the largely Christian militia based in the town and known as the Nineveh Plain Protection Units, said his men tried to hold their ground but were overwhelmed.

“We tried to fight them, but we couldn’t due [to] our limited capabilities,” he said. “We have only some old rifles we bought from our own money.”

He said he was near the attack that mortally wounded the Navy SEAL, when a U.S. military contingent came to assist the struggling militia forces.

“American Special Forces came to rescue us in four vehicles,” he said. “They opened the way for us to retreat, then one of their vehicles was hit.”

The general added that when he entered Teleskof after the assault, he saw the U.S. military vehicle abandoned with one of the doors destroyed by an explosion. He was not certain how the SEAL died.

“I think an RPG shot the car,” he said. “Then maybe a sniper shot the person inside.”

Matthew VanDyke, an American fighting alongside the Nineveh Plains Protection Units, who also was nearby, said the SEAL was hit by a sniper shot. A U.S. military official confirmed that the death was caused by small-arms fire. VanDyke said that about 20 Navy SEALS arrived not long after the town was lost about 6 a.m., traveling a few vehicles behind peshmerga forces in a convoy.

“They went straight into the fight,” he said. “They lined up on the edge of the town, and they were unloading on ISIS.”

The SEALs were “a few vehicles behind” the peshmerga forces as they tried to retake the town, when a car bomb struck the front of the convoy, VanDyke said.

“Every time we’d try to advance, they’d send car bombs,” he said. It was during that encounter that the SEAL was killed, he said.

The SEALs kept fighting but ran low on ammunition and pulled out as hundreds of peshmerga reinforcements arrived, VanDyke said. “The SEALS were involved in direct action. That’s for sure.”

In Washington, White House press secretary Josh Earnest said: “Today’s incident is a vivid reminder of the risk our service members are taking, and three of them now have made the ultimate sacrifice for our country.” He stressed that the U.S. mission in Iraq “is to support Iraqi forces on the ground that are taking the fight” to the Islamic State and that “Iraqi forces must fight for their own country.”

Earnest said that U.S. troops cannot act “as a substitute” for Iraqi forces.

A U.S. defense official, speaking on the condition of anonymity to comment candidly, said U.S. military leaders were still assessing what happened. F-15 fighter jets hit about 20 Islamic State targets in an effort to repel the attack, the official said.

The defense official said U.S. operational reporting suggests the SEALs already were at the scene of the attack when it began and got “caught up in this,” but he added that that was not yet clear. The SEALs have been working with the peshmerga for months in northern Iraq, he added.

A counteroffensive had retaken the town by late afternoon Tuesday.

“The coalition had the key role in retaking the village,” Jalil said. The Islamic State launched the attack, he said, because it is under pressure south of Mosul near Makhmour, where Iraqi forces, with the help of U.S. artillery and air power, have managed to make inching gains.

“It’s showing how desperate and how broken they are,” he said. “There are now more than 100 dead bodies of them in the village, plus they lost many vehicles,” he said.

Jabbar Yawar, a spokesman for the Kurdish peshmerga, said that a number of Kurdish fighters died in the attack but that he could not disclose how many.

“This sad news is a reminder of the dangers our men and women in uniform face every day in the ongoing fight to destroy ISIL and end the threat the group poses to the United States and the rest of the world,” Pentagon press secretary Peter Cook said in a statement, using an acronym for the Islamic State.

[Expanded U.S. force approved for Iraq]

Defense Secretary Ashton B. Carter first announced the death while traveling in Stuttgart, Germany. He said the service member was killed by enemy fire but offered few additional details.

U.S. Special Operations troops operate across peshmerga front lines, often spending hours at outposts gathering information about Islamic State activity.

The small detachments, however, are usually stationed a few miles from the front to help coordinate airstrikes between peshmerga fighters and the joint command centers in Baghdad and Irbil, the administrative center of the semiautonomous Kurdish region in northern Iraq.

Some 200 U.S. Marines also are stationed less than 10 miles from the front line, near the northern town of Makhmour, where Iraqi troops are building up for a future Mosul offensive. Marine Staff Sgt. Louis Cardin was killed there in a March 19 rocket attack.

Prior to Tuesday, 15 American service members had been wounded in the campaign, according to Pentagon statistics.

Lamothe reported from Washington. Thomas Gibbons-Neff in Stuttgart, Germany, and William Branigin in Washington contributed to this report.

Read more:

NATO considering thousands of troops near Russia’s border

Protesters leave Baghdad’s Green Zone a day after ransacking parliament

Fighting erupts in Iraq, and the Islamic State isn’t part of it

Today's coverage from Post correspondents around the world