Defense Secretary Ashton B. Carter at the Pentagon on Dec. 11, 2015. (Yuri Gripas/AFP/Getty Images)

Defense Secretary Ashton B. Carter offered Iraq expanded military assistance during a visit to Baghdad on Wednesday as the Obama administration seeks new ways to boost the country’s efforts against the Islamic State.

Carter’s visit, his third stop on an end-of-year Middle East tour, comes as Iraqi forces seek to push deeper into Ramadi, the capital of the western Anbar province, which has been in the grip of Islamic State fighters since May.

The military operation in Ramadi is an important test of Prime Minister Haider al-Abadi’s ability to muster government forces against the group and of President Obama’s strategy of relying on local partners to battle a militant organization that has spawned affiliates from Libya to Afghanistan.

Victory in Ramadi — just 80 miles west of Baghdad — would allow Iraqi security forces to refocus on the northern city of Mosul, considered the Islamic State’s de facto capital in Iraq and the prize in the U.S.-backed campaign there.

“We do want to help you build on your success in Ramadi, to move toward Mosul,” Carter told Abadi at a meeting at the government palace in Baghdad’s fortified Green Zone.

“It’s your victory, and it’s your advance,” he said later in a meeting with Defense Minister Khaled al-Obeidi. “But we look forward to . . . increased opportunities, at your request, with your permission, to assist you in making that move.”

Iraqi officials did not appear ready to seize upon all forms of U.S. assistance on offer. Their decision to refrain, at least for now, from requesting attack helicopters publicly proposed by Carter last week suggests that American plans to provide additional support to local forces will be subject once more to the contours of Iraqi politics.

Speaking to reporters after talks with Abadi, Carter said the Iraqi prime minister made no “specific request” for attack helicopters to be used in the Ramadi campaign. But they “certainly might be taken up” for future battles, he said.

Last week, Carter told Congress that the United States would provide attack helicopters or combat advisers if they are requested by the Iraqi government and if circumstances indicate a need.

Use of helicopters such as Apache gunships would allow U.S. forces to provide immediate, accurate close air support to Iraqi troops, acting more effectively as an extension of those ground forces than fixed-wing aircraft could.

But a decision to employ the helicopters — like a move to embed U.S. advisers with lower-level Iraqi units — would draw the United States even deeper into the war and would expose U.S. troops to greater risk.

U.S. officials said military leaders in both countries had deemed such steps unnecessary for now as Iraqi forces make some headway in Ramadi.

“It’s not either Gen. MacFarland’s judgment or the prime minister’s judgment that they’re needed right now for the completion of the fight in Ramadi,” Carter said, referring to Army Lt. Gen. Sean MacFarland, the top U.S. commander for Iraq and Syria. “That does not mean that they won’t make a difference in the future.”

The stakes are high for Abadi, who must prove his government can regain control of militant-controlled areas. Since he took power over a year ago, the Iraqi leader also has had to balance assistance from Iraq’s allies, including the United States and Iran, and ensure that he is not seen as too reliant on the West.

Speaking at the beginning of his meeting with Carter, Abadi said that Iraqi forces are on the “verge of breaking the back” of the Islamic State in some areas and praised his forces for making “huge progress” in Ramadi.

In recent days, Iraqi forces have claimed parts of Ramadi and reversed a militant counterattack in what U.S. officials describe as a slow and deliberate attempt to penetrate Islamic State defenses.

American officials are hoping that that effort will illustrate the progress foreign advisers have made in strengthening Iraq’s shattered army and also demonstrate the ability of official security forces to succeed without paramilitary forces backed by Iran.

For months, Obama administration officials have been hoping that Abadi will succeed in securing the support of Iraqi Sunnis, distinguishing himself from former prime minister Nouri al-Maliki. But Abadi, from the same Shiite political party as Maliki, must tread carefully as he pushes government security forces deeper into heavily Sunni Anbar province.

MacFarland said that U.S. military leaders were mindful of political complexity in Iraq. “We sometimes have to adjust the things that we would do on a chessboard,” he said. “It’s kind of hard to inflict support on somebody.”

Speaking to reporters at the Baghdad airport, he said the helicopters and advisers might accelerate progress on the ground. “It’s going to depend on the situation as we move forward in the campaign,” he said.

The visit also provided Carter an opportunity to get an early assessment of a package of new military measures designed to make the U.S. effort more effective.

Those steps, which Obama approved in late October, include intensified airstrikes, establishing a new Special Operations task force in Iraq and inserting a small number of Special Operations advisers into Syria.

After 16 months of U.S. and allied air strikes in Iraq, the Islamic State has been ousted from several smaller cities but remains in control of Mosul, Iraq’s largest northern city, as well as much of Anbar, the vast desert province in western Iraq.

Iraqi commanders say they are preparing to storm the center of the Ramadi. But the presence of civilians complicates the offensive, which so far has been heavily reliant on U.S. air support.

Islamic State fighters launched Tuesday’s counteroffensive on Iraqi army forces east of the city using five car bombs, five suicide bombers and 35 fighters in a bid to seize a strategic hill on the city’s edge, said Brig. Gen Hamid al-Fatlawi, head of the Iraqi army’s 8th Division.

The militants briefly took some ground but were pushed back by Iraqi army units.

“Our forces were able to withstand this attack with the help of the coalition,” he said. “They are desperate.”

Army Col. Steve Warren, a U.S. military spokesman, said an Iraqi force of about 10,000 is encircling Ramadi, where as many as 500 militants are believed to remain. But the Islamic State fighters have fortified their positions, making an offensive much harder for Iraqi troops.

Maj. Gen. Thamir Ismail, an officer with Iraqi police forces in eastern Ramadi, said Iraqi forces defused 62 roadside bombs and killed 13 Islamic State militants Tuesday. A final push into the city will happen in the next “few days,” he said.

In an indication of the continued unrest elsewhere in the country, Islamic State militants launched a fierce offensive on multiple Kurdish positions in northern Iraq on Wednesday, Kurdish officials said. The militants used nine car bombs and eight suicide bombers, killing seven soldiers, according to Kurdish military spokesman Hemin Hawrami.

More than 25 airstrikes by coalition jets held off the attack, and more than 70 militants were killed, Kurdish authorities said in a statement.

Rockets were also fired at a camp where Turkish troops have been stationed while they train Iraqi forces. Turkey reduced the size of its force at the base this week after protests by the central government, which had not authorized the presence of extra Turkish troops. Four Turkish soldiers were wounded, according to Turkish media reports.

Also, a Qatari hunting party — including members of the royal family — was kidnapped in the largely Shiite southern province of Muthanna early Wednesday, Iraqi officials said. Two Iraqi security officials escorting the party were released, but 19 Qataris remain missing, said Ahmed Manfi, deputy head of the province’s security committee.

Mustafa Salim in Baghdad and Thomas Gibbons-Neff in Washington contributed to this report.