BAGHDAD — Vice President Dick Cheney warned Monday against large U.S. troop cuts that could jeopardize recent security gains in Iraq, as he marked the fifth anniversary of the U.S.-led invasion with a two-day visit to the country.

Cheney used words like "phenomenal" and "remarkable turnaround" to describe a drop in violence in Iraq, and he hailed recently passed legislation aimed at keeping Iraq on a democratic path.

"It would be a mistake now to be so eager to draw down the force that we risk putting the outcome in jeopardy, and I don't think we'll do that," Cheney said after spending the day zigzagging through barricades and checkpoints to get to meetings in and out of the heavily guarded Green Zone.

He spent the night at a U.S. military base, the second overnight stay in Iraq for the vice president — the highest-ranking official to do so. Reporters accompanying him were not allowed to disclose the location. Last May, Cheney stayed at Camp Speicher, a base near former leader Saddam Hussein's hometown and about 100 miles north of Baghdad.

"It is good to be back in Iraq," Cheney, dressed in a suit and dark cowboy boots, said after his meeting with Prime Minister Nouri al-Maliki. "It's especially significant, I think, to be able to return this week as we mark the fifth anniversary of the beginning of the campaign that liberated the people of Iraq from Saddam Hussein's tyranny and launched them on the difficult but historic road to democracy."

He acknowledged that there is still a lot of difficult work to be done in Iraq, where 160,000 troops are deployed and the U.S. death toll is about to top 4,000. His own motorcade, escorted by Humvees manned by troops with machine guns, never ventured farther than about a mile outside the Green Zone.

"But as we move forward, the Iraqi people should know that they will have the unwavering support of President Bush and the United States in consolidating their democracy," Cheney said.

Security has improved markedly since last summer, when the last of five Army brigades arrived in Iraq to complete the president's buildup of 30,000 troops. One brigade has already returned home and the four others are to leave by July. What remains unclear is whether Bush will order additional drawdowns in the final months of his presidency.

Bush's decision last January to increase troops put to rest any notion, "here inside Iraq or in the region, that people could 'wait us out,"' Cheney said.

Shortly after the vice president arrived at the base for the night, there was a sustained burst of 50-caliber machine gunfire in downtown Baghdad. Earlier in the day, a suicide bomber killed 39 people in Karbala and a bomb in a parked car in a Baghdad neighborhood killed three civilian bystanders.

Iraq was not on Cheney's announced schedule for a 10-day Mideast trip that includes stops in Oman, Saudi Arabia, Israel, the Palestinian territories and Turkey.

Cheney was flanked at a news conference by Ambassador Ryan Crocker and Gen. David Petraeus, who are working on a status report on the war and will testify to Congress next month.

"We're keenly aware of the strain and the stress that these extended deployments have put on soldiers and their families and we would love to draw down further, but that is dependent on conditions on the ground," said Petraeus, the top U.S. commander in Iraq.

Cheney deemed the war a "difficult, challenging, but nonetheless successful endeavor" that has been "well worth the effort."

In Washington, Senate Majority Leader Harry Reid accused Cheney of minimizing the costs and consequences of the war.

"It would be far better," Reid said, "if the vice president would explain how his administration intends to use its final months to find Osama bin Laden and al-Qaida's senior leadership — neither of whom are in Iraq — as well as how it intends to win the war in Afghanistan and address our military's readiness challenges that leave us unprepared for the next crisis."

Cheney did not cross paths with the GOP's expected presidential nominee, Arizona Sen. John McCain, who left Baghdad after a weekend visit.

The vice president brushed off Iranian President Mahmoud Ahmadinejad's recent visit to Baghdad and said it was not widely discussed at his meetings with Iraqi leaders. Cheney said U.S. allies in the Arab world should send ambassadors to Iraq as a counter to Iran, which is seeking a greater sphere of influence in the Middle East and is accused of supporting terrorists and extremists in Iraq.

In a country with the world's third-largest known crude oil reserves, Cheney acknowledged that the declining value of the U.S. dollar was a factor in helping drive up global oil prices. He said another problem was that there was not a lot of excess capacity at a time when India, China and growing oil-producing nations themselves are seeking more energy.

Cheney met for about an hour with al-Maliki. He lauded the Iraqi government's legislative successes, but he also pointed to items left undone. The Iraqis do not yet have a law for sharing the nation's oil wealth among the Shiites, Sunnis and Kurds, a law that the Bush administration believes will trigger multinational energy companies to invest in exploration and production in Iraq.

Also unfinished is a plan for new provincial elections — a subject discussed as Cheney lunched on chicken, rice and humus with Iraq's presidential council. The three-member council, which must give its nod to laws passed by the Iraqi parliament, rejected a plan for new elections last month, shipping it back to the legislature.