An American serviceman was killed in Iraq by fire from the Islamic State group during an attack on Iraqi Kurdish positions outside the IS-held city of Mosul on Tuesday morning.

It was the third death of a US service member in Iraq since the US-led coalition launched its campaign against IS militants in the summer of 2014.

US defence secretary Ash Carter first announced the death, speaking to reporters in Stuttgart, Germany, where he has been consulting with European allies this week on fighting the Islamic State group. Mr Carter described it as a "combat death" but provided no immediate details.

A defence official said the service member was killed in an attack early on Tuesday morning. Pentagon Press Secretary Peter Cook said he was killed near Mosul, Iraq's second-largest city, which has been in the hands of IS militants since they overran large swaths of northern and western Iraq in the summer of 2014.

The US Central Command, or CENTCOM, said only that a coalition service member was killed "in northern Iraq as a result of enemy fire".

A US military official in Iraq said the American died in the line of duty as an adviser to the Kurdish peshmerga troops. The identity of the service member was not immediately known in line with military procedure to first notify next of kin.

The military official said the soldier was killed by "direct fire" after Islamic State forces penetrated the peshmerga forces' forward line. The American was three to two to three miles behind that front line before the attack was launched, the official added.

Major General Jaber Yawer, the Kurdish peshmerga spokesman, said that the American was killed by IS sniper fire near the town of Teleskof during an IS attack on Tuesday that also involved a number of car bombs.

The US and defence officials did not say specifically say that it was sniper fire that killed the US serviceman.

Vice President Joe Biden visited Baghdad last week to exhort leaders of the government in Iraq to resolve internal political strife and concentrate on the effort to defeat the Islamic State group.

Mr Carter also visited Baghdad recently. The Obama administration has been pressing the effort against IS, which has been slowed down in its quest to overrun Iraq.

The last killing of a US service member in Iraq was in March, when a US Marine stationed at Makhmour base outside the IS-held city of Mosul was killed by an IS rocket attack.

The first US service member killed in Iraq was a special operations solider killed in a firefight in October 2015 during a raid on an Islamic State group prison.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.