Members voted 298 to 273 on Tuesday against an opposition motion calling for senior politicians to investigate the run-up to the 2003 conflict and its aftermath.
The parliamentary majority of Tony Blair's government was cut as some of his MPs voted against the party line.
The prime minister averted what would have been a damaging defeat after Margaret Beckett, the foreign secretary, raised the possibility of an inquiry into the war once the fighting was over and British troops were home.
A parliamentary motion calling for an immediate investigation of the war by a committee of senior ministers was proposed by the minority Scottish and Welsh nationalist parties.
Blair opposed an inquiry while British troops were still in Iraq.
Blair is already seen by some as being under the spotlight after pledging to step down by next September, but a defeat in parliament might have further weakened his authority and even hastened his departure.
Adam Price, an MP of the Welsh nationalist party Plaid Cymru, said: "I think that most members of parliament, many accept now that we were actually sold this policy based on false claims about an arsenal of weapons that didn't exist.
"We really need to understand how the government came to get it so badly wrong."
Alex Salmond, leader of the Scottish National party, told GMTV television that the war had "obviously gone badly wrong".
"We are stuck in a bloody quagmire in Iraq with no end in sight," he said.
"It is also to see if we can mobilise the degree of concern in the House of Commons [the lower house of parliament] about the developing situation because many, many people think a change of strategy is badly required and if that required an immediate change in prime minister to secure that strategy then so be it."