BAGHDAD-- U.S. Secretary of State John Kerry backed Iraq's prime minister on Friday in his efforts to resolve a mounting political crisis, underlining the importance of securing a "unified and functioning government" in thefight against the Islamic State of Iraq and Syria (ISIS). Kerry also pledged $155 million in new U.S. aid to Iraq.

Making an unannounced visit to Baghdad, his first in two years, Kerry held discussions with Prime Minister Haider al-Abadi as well as Iraq's foreign minister, the Sunni speaker of parliament and a Kurdish regional leader in what was designed as a show of support for the Iraqi government as it struggles with ongoing security, economic and political challenges. He described al-Abadi's effort to reshuffle his cabinet as an internal matter, but said all sides in Iraq must put sectarian or personal interests aside for the sake of the nation's future.

"It is important to have stability," Kerry told reporters. "And it is important to have a unified and functioning government as soon as possible, so that these operations are not affected."

Get Breaking News Delivered to Your Inbox

Kerry's trip coincides with military advances. Iraqi forces say they entered the strategically important IS-held town of Hit on Thursday, while the Pentagon is considering establishing more small military outposts to provide artillery support and other aid to Iraqi forces readying an assault on Mosul, the ISIS stronghold in the country. Last month, the U.S. opened the first such base since returning to Iraq in 2014.

But al-Abadi faces challenges of his own, still trying to establish a new cabinet amid pressure from supporters of a hard-line Shiite cleric who last month staged rallies and a sit-in next to the government headquarters to demand reforms. A prolonged standstill could severely hamper al-Abadi's ability to effectively lead a country that has often broken down along sectarian lines since the U.S.-led overthrow of Saddam Hussein 13 years ago.

"We don't play a role in that," Kerry said, trying to emphasize neutrality. But he also said he had "no doubt" that al-Abadi was "extremely focused on making certain that there is a strong government in place" and hailed the prime minister for demonstrating "critical leadership" in the face of enormous difficulties.

Corruption is at the heart of the internal debates, a problem compounded by Iraq's weakened economic state as a result of crumbled oil prices.

Last August, al-Abadi proposed a sweeping reform package to combat corruption, cut government spending and merge ministries, but it has been stymied by sectarian tensions and struggles to contain ISIS. Its forces swept across much of northern and western Iraq in the summer of 2014. While Iraqi authorities have waged a full-scale war, aided by U.S. airstrikes, the Kurdish peshmerga forces, Shiite militias and pro-government Sunni fighters, the extremist group still holds significant territory.

Kerry said the war is being won, albeit slowly.

Even though some predicted Baghdad's fall two years ago and "people were clamoring for the United States to do something about it," Kerry said the ISIS onslaught has now stopped and hasn't been on the offensive in months. He cited last year's ousting of ISIS in Tikrit to the retaking of Ramadi, and said the Islamic State also is on the run in Syria, where Arab-backed rebels seized one of the group's last remaining crossing points on the Turkish border.

"Daesh's days are numbered," Kerry said, using an Arabic acronym for ISIS. "We will succeed. And the evidence on the ground suggests that we are in fact doing that now."

ISIS has lost 40 percent of its territory in Iraq, Kerry said. Oil revenue is down by almost a third. Airstrikes on cash storage sites have cost the extremists millions of dollars, leading rank-and-file fighters to disobey orders, flee positions and hide among civilians as they've watched their paychecks dwindle and the group lose its aura of invincibility.

The U.S. is trying to speed up victory. The extremist group's territories in Iraq and Syria are still a magnet for foreign fighters, and cells are expanding around the world. And experts say ISIS' staying power may be inspiring others, who've never been in contact with the group, to wage violence in its name. Recent attacks in Brussels, Paris and California underscore Western fears.

Kerry outlined significant remaining work - not least the long-delayed offensive to chase the extremists out of Mosul, Iraq's second largest city.

But right now, Kerry said, the Iraqi army is still "shaping the operation." He offered no time frame for when the actual assault might begin, and stressed that no additional American forces are being considered. There are 3,870 U.S. forces in Iraq currently, though the number fluctuates.

"There was no request from Prime Minister Abadi for some new infusion of troops at this point in time, and nor did we discuss that," Kerry said.

The new U.S. aid will support Iraqis displaced within the country of forced to flee abroad as refugees. More than 3.4 million Iraqis have been uprooted in the last 2 ½ years. American humanitarian assistance over that time now totals $778 million.