BAGHDAD - U.S. Defense Secretary Chuck Hagel arrived in Baghdad today as the United States expands its presence in the fight against Islamic State militants four months after starting a campaign of air strikes in Iraq.

Hagel is the first U.S. secretary of defense to visit Iraq since President Barack Obama ordered American troops out of the country in 2011. With the advance of Islamic State militants, Obama started ordering troops back to Iraq this summer.

Speaking to reporters ahead of the visit, Hagel said the Iraqi army and Kurdish forces were gaining momentum.

"This is a long term effort. It's difficult. There will be setbacks. There will be victories. So I think that's where we are and I look forward to getting some first-hand assessments," he told reporters in Kuwait on Monday.

Last month Obama authorised roughly doubling the number of U.S. ground forces to 3,100 as the military expands the reach of its advisers and starts training Iraqi and Kurdish forces.

The U.S. commander for Operation Inherent Resolve in Iraq and Syria, Lieutenant General James Terry, said U.S. coalition allies would send about 1,500 troops to help train and advise local forces.

Since their June offensive, Islamic State's Sunni militants have had little success breaking beyond the solidly Sunni Muslim provinces of Anbar in the west and Salahuddin north of Baghdad, as well as the strongly Sunni province of Nineveh, home to the city of Mosul which the Islamists overran in June.

Iraqi and Kurdish forces have made gains, including securing Mosul dam.

Terry said while the Islamic State still conducted limited attacks the group appeared broadly "on the defense, trying to hold what they have gained".

"When you look at some places out in Anbar, it's a little bit stalemated out there. And we've got some work to do. And I think it's do-able."

Hagel is making his last official visit abroad as defense secretary. He resigned under pressure last month after nearly two years as Pentagon chief.

The Republican senator broke with his party to become a fierce critic of the Iraq war during the administration of former president George W. Bush.

A Vietnam veteran, he once called Bush's plans to raise the number of troops in Iraq "the most dangerous foreign policy blunder" since Vietnam.