The vice-president started his tour on Sunday by meeting Iraqi political leaders and military commanders in the Green Zone and watching an Iraqi troop training demonstration at the Taji air base.
Cheney then had lunch with the US soldiers who had enforced security measures for Thursday's parliamentary elections, before ending the day with a speech.
After an hour-long briefing from the war's top US military chiefs, Cheney said: "The participation levels all across the country were remarkable. And that's exactly what needs to happen as you build a political structure in a self-governing Iraq that can unify the various segments of the population and ultimately take over responsibility for their own security."
The high-security visit was so shrouded in secrecy that even Iraq's prime minister said he was surprised when he showed up for what he thought was a meeting with the US ambassador, only to see Cheney there.
Cheney's tour came on the same day that George Bush, the US president, was due to give a prime-time Oval Office address on the subject of Iraq.
Vice-presidential aides said the timing was a coincidence. But the two events form part of a public relations blitz aimed at using the parliamentary elections to rebuild support for the war among the American public.
A majority of Americans have said they disapprove of Bush's handling of the war, and the White House has been pushing back hard against calls for US troop withdrawals.
There have been increasing calls
in the US to withdraw troops
Cheney flew around the Baghdad area in a pack of eight fast-moving, heavily armed Black Hawk helicopters.
He flew along the airport road that has been the site of many deadly attacks and passed over the courthouse where Saddam Hussein's trial is being held.
He addressed hundreds of American service members who had gathered to hear a "mystery guest".
The vice-president said: "You've heard some prominent voices advocating a sudden withdrawal of our forces from Iraq. Some have suggested that the war is not winnable and a few seem almost eager to conclude the struggle is already over. But they are wrong. The only way to lose this fight is to quit, and that is not an option."
Cheney last visited Iraq in March 1991, when he was defence secretary for Bush's father, George H W Bush, the US president at the time. His visit on Saturday made him the highest-ranking official in the current Bush administration to visit the country since Bush's unannounced trip on Thanksgiving Day in 2003.
His first stop was the US ambassador's residence, where he had an hour-long briefing with Zalmay Khalilzad, the US ambassador to Iraq, and two US generals.
He then went on to meetings with Ibrahim al-Jaafari and Jalal Talabani, the president and prime minister of Iraq, the latter still sporting a stained purple finger after voting on Thursday.
Cheney said even though final elections results were not in, he was encouraged by early figures showing a jump in turnout in areas, such as al-Anbar, with a large proportion of voters who are Sunni Muslims.
Early election figures show an
encouraging turnout from Sunnis
The unannounced stop in Iraq came at the beginning of a five-day tour aimed at strengthening support for the US War on Terror. Cheney and his wife, Lynne, now plan to visit Oman, Afghanistan, Pakistan, Egypt and Saudi Arabia.
Cheney is also expected to attend the opening of the Afghan parliament on Monday.