MARIAM BEK, Iraq - As Islamic extremists seek to sweep away borders in their advance across the Middle East, Kurds in northern Iraq appear to be in the process of digging a new one, asserting their claim to hotly disputed territory and expanding their semi-autonomous region in a bid for greater autonomy or outright independence.
The emerging frontier of sand berms, trenches and roadblocks is being built to take in areas Kurdish fighters seized as Sunni militants led by the Islamic State of Iraq and the Levant swept across northern Iraq last month, routing the armed forces of the Shiite-led government in Baghdad and raising fears the country could be torn in three.
Kurdish forces say they assumed control of the disputed territory in and around Kirkuk -- a major oil hub -- to prevent it from being taken over by the Sunni insurgents as Iraqi troops melted away. They say the defense of the 600-mile frontier is necessary to prevent the militants, who have declared a transnational Islamic state straddling the Syrian-Iraqi border, from advancing further.
"This is a security measure. We are dealing with a serious threat," said Falah Bakir, the Kurdish region's top foreign policy official. "We are neighbors to a terrorist state - the Islamic State - and we have to take measures to ensure our safety."
But the barriers, hastily built over the past few days, are also defining the borders of a possible future Kurdish state, and laying the groundwork for a conflict with Baghdad over Kirkuk, which has a mixed population of Kurds, Arabs and Turkmen.
Politicians close to Shiite Prime Minister Nouri al-Maliki have condemned the Kurds' assertion of control over the disputed areas outside their semi-autonomous region, accusing them of exploiting the security breakdown to pursue their long-held dream of greater autonomy or outright statehood.
The United States and Iraq's regional neighbors Turkey and Iran -- both of which have large Kurdish minorities -- are opposed to Kurdish independence.
The Kurds say they have tried for years to reach an agreement with Baghdad on where to draw the frontier of their semi-autonomous region, but say the Shiite-led government and Sunni leaders dragged their feet. They point to a constitutional amendment requiring that Kirkuk's fate be decided by referendum, but which has never been implemented.
"If the Shiite forces and the Sunni forces don't abide by this pact between the sides, to draw the borders of Iraq, to draw the borders of the province of Kurdistan, so it is the right of the Kurdish province to take the areas that were taken away from it," said the Kurdish deputy head of the Kirkuk Provincial Council, Rebwar Talabani.
Over the past week, Kurdish forces known as the peshmerga have erected dirt barriers outside Iraq's second largest city of Mosul, which was seized by the Islamic State last month. The barriers take in disputed territory but also protect nearby villages inhabited by Christians and other minorities from the Islamic extremists.
At the last peshmerga checkpoint before Mosul mounds of earth several yards high and rows of concrete barriers flank the highway. A Kurdish fighter wearing beige military fatigues stood in the back of a jeep, scanning the horizon with binoculars.
"We are drawing the border on the disputed areas, which is our right," said the jeep's driver, who asked not to be identified because he was not authorized to speak to the press. When asked about the objections voiced by the government in Baghdad, he laughed. "What government in Baghdad?"
At another point in the frontier, a few miles outside Kirkuk near the village of Mariam Bek, the border was marked by a muddy canal. The half-dozen bridges crossing over it were blocked to prevent suicide bombers from entering the city, said Gen. Shirko Fatih, commander of Kurdish troops in Kirkuk.
Just up the road, Islamic State fighters had built their own dirt barrier. Fifty miles further along is the city of Tikrit, the hometown of Saddam Hussein, which is held by the Sunni insurgents.
The Kurds argue that they are protecting everyone in Kirkuk from Islamic extremists, but an Arab official said his community would not accept the defensive fortifications being turned into a border.
"This for us is rejected," said Rakan Ali, the Arab deputy governor of Kirkuk. There was a difference, he said, between defending a city and seizing it.
The Kurdish foreign policy director Bakir insisted that any final borders would be set by referendum and not by dirt berms and concrete walls.
"Now that our forces are in this area, we will make a referendum to determine if the people want to be part of Kurdistan," he said.
But other Kurds look at the chaos engulfing Iraq and believe they should seize their moment and press all the way south to the Hamreen hills, some 130 miles from Kirkuk, a natural frontier.
"If we go to history, the border is not here, it is further away in Hamreen," said a 36-year-old commander in Mariam Bek, surveying the territory from a sniper tower. "This is not my border. We want more."