IRBIL, Iraq — Iraqi federal and Kurdish forces exchanged fire at their shared border on Friday, capping a dramatic week of maneuvers that saw the Kurds hand over territory across northern Iraq.

Iraqi forces shelled Kurdish military positions north and south of Altun Kupri, a town of about 9,000 people just outside the country’s autonomous Kurdish region, a day after Brig. Gen. Raad Baddai gave warning he was going to enter the town.

Organized Kurdish forces, known as the peshmerga, as well as irregular forces, responded with rocket fire.

By mid-day, Iraq’s Defense Ministry said anti-terrorism forces, the federal police and the country’s Iranian-backed Popular Mobilization Front militias had taken the town.

But the peshmerga’s general command disputed that claim, saying Kurdish fighters fought off the advance and destroyed 10 humvees and an Abrams tank.

Ercuman Turkmen, a PMF commander, said from inside the town his forces were being targeted by sniper fire. Speaking to the AP by phone, he said he had no orders to enter the Kurdish autonomous region.

There were no casualty reports but AP reporters saw ambulances outside the town.

The boundaries of the country’s Kurdish region have long been disputed between Baghdad and Irbil, the Kurdish capital, but Kurdish forces this week withdrew in most areas to positions they last held in 2014, effectively restoring the contours of the map to the time before the rise of the Islamic State group.

They pulled out of nearby Kirkuk after brief clashes and handed over surrounding oil fields nearly without a fight, but they held on to Altun Kupri, making a symbolic last stand in front of the vastly more powerful Iraqi army.

“The Kurdistan Peshmerga Forces have resisted heroically in this confrontation and have recorded a great honor,” the peshmerga general command said in a statement released mid-day.

Altun Kupri is the last town on the federal side of the border on the road between Kirkuk and Irbil.

Kurdish forces entered Kirkuk in 2014 when Iraq’s army melted away ahead of the Islamic State group’s blitz across northern and western Iraq.

The city, home to over 1 million Arabs, Kurds and Turkmen, emerged at the heart of the dispute over whether Kurdish authorities should return the territories it acquired during the war on IS. They have lost an important stream of oil revenues with the loss of the city, dealing a serious blow to aspirations for independence.

Kurdish leader Masoud Barzani championed a non-binding vote for Kurdish independence in September. Baghdad condemned it and instead demanded the return of the disputed territories, precipitating the crisis.

The peshmerga are vastly outmatched by Iraq’s federal armed forces and the Iranian-sponsored militias that fight alongside them. Both the Kurds and the federal forces are accustomed to calling and receiving coalition air support as part of their shared war on the Islamic State group.

“There’s nothing we can do about it, honestly. I’m urging the coalition forces to come and help us.” said peshmerga fighter Ibrahim Mirza. “No doubt we have martyrs.”

Kurdish authorities sent reinforcements to the front lines. An Associated Press team saw a convoy of dozens armored vehicles arriving at the Kurdish side of the front, and fighters waiting in the town of Kustepe, on the Kurdish side of the border.

Thick black smoke rose from a checkpoint north of Altun Kupri after it was hit by a shell, and ambulances rushed from the front lines into Kurdish areas.