Nouri al Maliki said the announcement this week by the Islamic State of Iraq and the Levant (Isis) that it has unilaterally established a caliphate "is a message to all the states in the region that you are inside the red circle now".
He said in his weekly address to the country: "No one in Iraq or any neighbouring country will be safe from these plans."
The Sunni extremist group has overrun huge areas of northern and western Iraq in recent weeks, linking up with territory already under its control in neighbouring Syria.
Isis declared its leader Abu Bakr al Baghdadi as the head of its new self-styled state, governed by Sharia law, and demanded all Muslims pledge allegiance to him.
The blitz across Iraq appears to have halted, at least for now, as it reaches Shi'ite-majority areas where resistance is tougher.
In what appeared to be a bid to peel away some of the extremist group's allies among Iraq's Sunni tribes, Mr Maliki offered an amnesty "for all tribes and people who got involved in any act against the state".
He added: "They should return to their senses. We are not excluding anybody, even those who committed misdeeds, apart from those who killed or shed blood.
"I welcome them to return and stand with the other tribes that have taken up arms."
Mr Maliki offered a similar amnesty after militants seized two cities in central Iraq early this year, but few if any Sunnis took up his offer.
With its recent gains, Isis now controls an area that stretches from northern Syria to the outskirts of Baghdad in central Iraq.
That has sent tremors across the region, particularly in the capitals of Iraq's neighbours - Saudi Arabia, Jordan and Iran.
The Sunni insurgents' offensive is fuelled, at least in part, by the Sunni minority's long list of grievances with Mr Maliki and his Shi'ite-led government.