"I think two years will be enough and more than enough to establish security," he told reporters on Monday after talks with British Prime Minister Tony Blair.
US Defence Secretary Donald Rumsfeld said on Sunday that revolt among Sunni Arabs against Iraq's Shia-led government could go on for many years.
Asked about Rumsfeld's comments that the violence could go on for a decade or more, Blair told a news conference earlier that he did not know how long it would last, adding: "It's the next year in my view that is absolutely decisive in this."
Blair backs talks
Violence has worsened sharply in the two months since al-Jaafari's Shia- and Kurdish-led government took office.
Aljazeera reported Blair as saying that he supported talks held between US and British officials and armed groups in Iraq.
"I think two years will be enough and more than enough to establish security"
Iraqi prime minister
In a press conference with his Iraqi counterpart, Blair said Iraqi fighters would have a role in the political process if they abandoned violence.
Rumsfeld had said on Sunday that the US had held talks with fighters in an attempt to differentiate between Iraqi fighters and those sneaking in from outside the country.
Al-Jaafari said the exact time it would take to make the country safe depended on several factors, including getting Iraqi security forces well trained and better-equipped and making progress with the political process.
He also said neighbouring countries would play a part in helping to control the borders which are crossed by some fighters.
Washington and London have said their troops will stay until Iraq's security forces are sufficiently well trained to cope.
On Tuesday, Baghdad called for ending a United Nations programme under which it pays compensation for damage from its 1990 invasion of Kuwait and the 1991 Gulf war, arguing debts should be settled bilaterally.
Iraqi Deputy Foreign Minister Muhammad Hamud Bidan spoke to Reuters before addressing the UN Compensation Commission, which uses 5% of Iraqi oil revenues for compensation payouts.
"We suggest we stop the payments of 5% from oil revenues ... it is too much for us. We think it is time now to stop and leave Iraq to negotiate directly with the states concerned," Hamud Bidan said in Geneva.