Iraq's Federal Supreme Court ruled on Wednesday that the federal government can deploy troops to the country's international borders, including in the semi-autonomous Kurdish region. State television reported the decision.

The court also ruled that federal authorities can oversee agencies at all border crossings, including those in Kurdistan. They must coordinate with regional and provincial governments on customs administration. The federal oil ministry can oversee and audit oil and gas fields, according to state TV. Baghdad shares responsibility for managing the oil and gas produced with regional governments and producing provinces.

The ruling follows a directive from Prime Minister Ali al-Zaidi, who ordered federal forces a day earlier to take over Kurdish-run border crossings. He also demanded authority over oil fields controlled by Kurdish security forces to curb oil smuggling. The Iraqi government has not said how or when the takeover will be carried out.

The Kurdistan Regional Government called the move "an assault" on the region's "constitutional rights." It also rejected what it called "military language and threats" in a statement from the Iraqi military. The regional government said it is working with federal authorities to combat corruption and called for an end to oil smuggling.

Iraq's state news agency, citing what it said was a federal intelligence report, said oil belonging to the state-owned North Oil Company was being diverted and smuggled from Kirkuk and from Sulaimaniyah to Iran and onward to Afghanistan.

A week earlier, al-Zaidi ordered troops to prepare to enter Jurf al-Sakhar, a stronghold south of Baghdad of Kataib Hezbollah, a Shia militia aligned with Iran. The group initially defied the order but allowed soldiers into the city after a compromise brokered by Shia politicians.

Renad Mansour, deputy director of the Middle East and North Africa programme at Chatham House, said Iraq's judiciary was "very much supportive" of the government's campaign to establish a centralised political order. A senior Shia politician close to al-Zaidi told Reuters that the prime minister is trying to dismantle a "state within a state." Analysts say implementing the measures against the Kurds and the armed Shia militias will be difficult.