Pakistan has said it will not support military action against Iraq.
Mr Jamali did not say how Pakistan would vote, or if it would abstain
Prime Minister Zafarullah Jamali told parliament that his government was opposed to any action that could harm the people of a Muslim country.
Correspondents say this is Pakistan's first clear statement on the subject of war with Iraq.
But it has still not indicated if it will oppose a US and UK-backed resolution in the UN Security Council that favours immediate military action, or abstain.
As one of the Security Council's 10 non-permanent members, Pakistan has been under intense pressure to side with its key ally, the United States.
All options for a peaceful resolution must be explored
However, the government appears to have decided not to go against public opinion in Pakistan which is strongly opposed to a US-led war against Iraq, correspondents say.
'Give peace a chance'
Mr Jamali, who is scheduled to visit the US later in the month, made his statement as parliament began a debate on the subject of war with Iraq.
"Pakistan will not become part of any aggression against Iraq," he told members of the lower house.
Most Pakistanis are against war with Iraq
"The cabinet unanimously decided to continue to base Pakistan's position on Iraq on principles and national interests.
"Peace must be given a chance and all options for a peaceful resolution must be explored."
A resolution tabled by the US and the UK gives Iraq until 17 March to rid itself of its nuclear, chemical and biological capabilities.
Mr Jamali said the government would decide which way to vote, when actual voting took place in the Security Council.
The BBC's Zaffar Abbas in Islamabad says it is not clear how the US will react to Pakistan's opposition to war - but the popularity of the prime minister will certainly be improved at home.
On Sunday, tens of thousands took to the streets of Rawalpindi to protest against plans to attack Iraq.
They were particularly critical of President Musharraf for failing to openly oppose military action against Iraq.