An Iraqi soldier removes a Kurdish flag from Altun Kupri, 25 miles north of Kirkuk city. Iraqi and Kurdish forces exchanged fire at their shared border Friday, capping a dramatic week of maneuvers that saw the Kurds hand over territory across northern Iraq. (Emad Matti/AP)

Iraqi and Kurdish forces exchanged heavy fire Friday as Iraqi troops backed by allied militias captured the remaining district of the disputed Kirkuk province.

The two sides, close military partners during the fight against the Islamic State, turned their weapons on each other early Friday, marking the heaviest clashes since Iraq's military began a campaign last week to reclaim areas it lost in 2014.

Kurdish peshmerga forces initially had withdrawn from large swaths of the province in the early days of the Iraqi military march on Kirkuk city. On Friday, groups of peshmerga fighters held firm and attempted to halt the Iraqi advance with rockets and mortars, Iraqi and peshmerga commanders said.

By late afternoon, the peshmerga forces retreated, and troops from Iraq's counterterrorism service, army and federal police, as well as members of a powerful Iran-backed Shiite militia, entered and took control of Altun Kupri, a small town about 25 miles northwest of Kirkuk city. They also took over the main checkpoint on the road to the Kurdish capital of Irbil, the Iraqi military said in a statement.

Col. Muntathar al-Shimaari, a commander with the counterterrorism service, described the Kurdish resistance as moderate and said the town "would be the last area of advance."

Lt. Gen. Jabbar Yawar, secretary general of the Peshmerga Ministry, conceded that Iraqi forces had taken control of Altun Kupri and said small clashes were ongoing late Friday in nearby villages.

He warned that any further advance would be met with fierce resistance.

"They are at the walls of Irbil, which is entirely unacceptable to us," he said of the Iraqi forces.

The assault capped a swift campaign by Baghdad to impose its authority over areas of the country that had been taken over by the semiautonomous Kurdish regional government in 2014 as the Iraqi army collapsed in the face of an Islamic State onslaught. Iraqi forces have now taken control of the oil fields in Kirkuk province that had been a major source of revenue for the Kurdish government, along with areas where the majority of the population is Kurdish, leading to fears of mass displacement.

In Washington, State Department spokeswoman Heather Nauert said the United States is concerned by the clashes in northern Iraq. She asked the Iraqi federal government to limit the movement of forces in disputed areas to promote calm.

"We are monitoring the situation closely, and call on all parties to cease all violence and provocative movements, and to coordinate their activities to restore calm," Nauert said in a statement.

"The reassertion of federal authority over disputed areas in no way changes their status — they remain disputed until their status is resolved in accordance with the Iraqi constitution," Nauert said. "Until parties reach a resolution, we urge them to fully coordinate security and administration of these areas."

The Trump administration has encouraged Baghdad and the Kurdish government to hold talks.

"The United States remains committed to a united, stable, democratic, and federal Iraq, and committed to the Kurdistan Regional Government as an integral component of the country," Nauert said.

The moves came on the heels of a Kurdish referendum on independence held last month that was vigorously opposed by Iraq's central government, along with the United States, the European Union, the United Nations, Turkey and Iran. The vote was held not only in Kurdish areas but also in Kirkuk and other disputed territory, roiling the Iraqi government, Turkey and Iran, which all moved to isolate the Kurdish region.

The military takeover of Kirkuk has been complicated by the presence of powerful militias that are funded and supplied by Iran, leading to speculation and accusations from Kurdish officials that Baghdad was acting under the influence of Tehran. Iraqi Prime Minister Haider al-Abadi has said the move into Kirkuk was necessary to preserve Iraq's territorial integrity.

President Trump has said the United States would remain neutral in the conflict between the two U.S. allies, leading to accusations of betrayal by some Kurdish officials and their supporters in Washington.

Anne Gearan in Washington contributed to this report.