WASHINGTON — The United States is prepared to deploy attack helicopters and additional advisers to help Iraqi forces in their long-running battle to retake the city of Ramadi from the Islamic State, Defense Secretary Ashton B. Carter said Wednesday.

For several months now, the Iraqi security forces have been advancing on the city, cordoning it off and surrounding it. It has been a slog, Pentagon officials say, because of entrenched Islamic State positions.

But as the forces make what they have billed as their final push into the city center, which will entail urban warfare, defense officials say they are considering the use of American attack helicopters. Such a move would deepen American involvement in the war and could bring helicopter pilots under increased risk from ground fire, but the Pentagon views it as a necessary step.

“The United States is prepared to assist the Iraqi Army with additional unique capabilities to help them finish the job, including attack helicopters and accompanying advisers, if circumstances dictate and if requested by Prime Minister Abadi,” Mr. Carter told a hearing Wednesday of the Senate Armed Services Committee, referring to Prime Minister Haider al-Abadi of Iraq.