BAGHDAD - Iraqi forces claimed to have taken control of a large area of Ramadi on Tuesday, entering the army headquarters in the city, which has been held by Islamic State militants for seven months.

Counterterrorism forces took control of the Tamim neighborhood, southwest of the city, commanders said, while troops entered the Anbar Operations Command headquarters to the north.

The gains on Tuesday represented a significant advance for Iraqi forces in their counteroffensive to retake Ramadi, capital of Anbar province. The stuttering operation, backed by U.S. airstrikes, has gained momentum in recent weeks. However, Iraqi forces still face significant challenges in expelling Islamic State militants from the city, which is laced with explosives and has a significant civilian population.

"It's a major victory today. Now we are in the center," said Maj. Gen. Ismail al-Mahlawi, who leads the Anbar command, speaking by phone from the army headquarters in the city. "It's only a matter of time before we announce the liberation of the city."

Mahlawi said families still need to be evacuated but that Iraqi forces had gained the upper hand.

Appearing on television, Prime Minister Haider al-Abadi confirmed the gains. "Very soon we will finish Ramadi," he said.

In the aftermath of the fall of the city in May, Abadi had said that it could be retaken "in days."

But Islamic State militants dug in, building significant defenses with booby traps and roadblocks.

Sabah Noori, a spokesman for Iraq's counterterrorism forces, said Tamim - a large area of 16 districts - had been cleared "entirely."

He said special-forces soldiers had taken positions on tall structures in the area, enabling them to pressure militants in the center. He said the operation in the southwest had left the enemy "trapped and distracted," allowing troops to enter from the north.