Iraq's highest court has ruled that Prime Minister Nour Al-Maliki could retain his position because his bloc is the biggest in the country's parliament, state television reported.
Al-Maliki has faced calls to step down amid the Islamic State insurgency in the north of the country, but according to the country's constitution, the president, must now ask him to form a new government.
Maliki, serving in a caretaker capacity since an inconclusive election in April.
The decision was described as "very problematic" by senior Iraqi official who asked not to be named.
"This will make the situation very, very complex," they told Reuters.
Kurdish Peshmerga fighters have emerged victorious in the battle for Mosul Dam, but the question is - what will their next move be?
An ITV News team at Mosul Dam was with victorious Kurdish Peshmerga fighters at the complex earlier today.
ITV News joined a Kurdish unit fighting Islamist militants near Irbil and found them using tanks from the 1950s and short on ammunition.