Large crowds protested in Irbil, also often written Erbil, early on Thursday, waving flags of Iraqi Kurdistan, the semiautonomous region in northern Iraq. Demonstrations were also reported in several other towns and cities.

The protests followed plans announced earlier in the week for Baghdad to take control of oil operations and border crossings run by Kurdish authorities. Iraqi Prime Minister Ali al-Zaidi said the measures were intended to stop oil smuggling.

Tuesday’s decision, backed by Iraq’s Federal Supreme Court a day later, puts border crossings in the Kurdish region under federal management. It also gives the federal oil ministry authority to approve oil exports from the region and transfers management of oil fields in four contested provinces: Kirkuk, Diyala, Salahuddin and Nineveh.

The Kurdish regional government’s Cabinet said on Wednesday that Baghdad’s decision “violates both the Constitution and the constitutional rights of the Kurdistan region,” and described it as “an attempt to return Iraq to a centralized regime.”

Al-Zaidi also dismissed Kirkuk’s operations commander and police chief, as well as the head of the Border Ports Commission. He said the measures reflected Iraq’s “independent national will.” Al-Zaidi took office earlier this year with the backing of US President Donald Trump.

Regional Prime Minister Masrour Barzani said his government was “surprised” by al-Zaidi’s decisions and called them “completely unacceptable.” Rival Kurdish parties joined forces for the protests in the regional capital.

The moves deepen a long-running power struggle between Baghdad and Kurdish authorities, who have largely governed themselves since 1991, although their recognition and authority have varied. Iraq’s 2005 constitution, drafted after the US-led invasion that toppled Saddam Hussein, formally recognized the Kurdish region and its government. Disputes over land, oil and money have continued between authorities in Erbil and Baghdad.

On Wednesday, Iraq’s Supreme Court ruled that the Kurdish Regional Government (KRG) had authority only over the land it administered on March 19, 2003, the day before the US-led invasion that unseated Saddam Hussein. Kurdish peshmerga forces moved into many disputed areas after 2003, including oil fields covered by this week’s orders.

Article 140 of the 2005 constitution called for reversing Saddam-era policies that expelled Kurds and moved Arabs into disputed areas, followed by a census and referendum on whether those territories should join the Kurdistan region. Neither was held. Kurdish forces later gained more disputed territory after Iraqi forces were driven out by the so-called “Islamic State.” Kurdish peshmerga forces subsequently reclaimed some land with some international assistance.

The disputed territories lie between Iraq’s borders with Syria and Iran and are home to many ethnicities and communities, with Kurds generally the majority group. The oil-rich region is important to both administrations in a country that relies on oil revenues for the vast majority of its public sector budget.

Political tensions within Iraqi Kurdistan have also complicated the issue in recent months. The Federal Supreme Court is hearing an ongoing challenge to the current government’s legitimacy after a party withdrew from the coalition cabinet. Rival Kurdish political factions, however, appear to have found common ground on this issue.