BAGHDAD, March 17 -- As the fifth anniversary of the invasion of Iraq neared, Vice President Cheney flew unannounced into Baghdad on Monday and declared the U.S. effort to install democracy and stabilize Iraq a "successful endeavor" that has been "well worth the effort."

Making his first visit since the deployment of 30,000 additional U.S. troops last year, Cheney characterized the changes in Iraq's security and political landscape as "phenomenal" and "remarkable." The vice president used the opportunity to reassert that there was "a link between Iraq and al-Qaeda" before the U.S. invasion, despite reports that have found no operational ties between the two.

The vice president's visit came on the same day that two U.S. soldiers were killed by a bomb near Baghdad and a female suicide bomber killed at least 40 people outside a Shiite shrine in Karbala. While Cheney traveled outside the heavily fortified Green Zone during the day, the streets were lined with troops and barriers, and some reporters traveling with him reported hearing explosions elsewhere in the city.

The five-year anniversary of the start of the war on Wednesday has prompted a variety of appraisals, not all as upbeat as the vice president's. Many Iraqis feel more optimistic because of the recent decline in violence, according to a new poll by ABC News and other news organizations, but they remain dissatisfied with the provision of basic services and job opportunities.

A report issued Monday by the International Committee of the Red Cross concluded that a humanitarian "crisis" has left millions of Iraqis with inadequate clean water, sanitation and health care.

"Five years after the outbreak of the war in Iraq, the humanitarian situation in most of the country remains among the most critical in the world," the 15-page report says.

The attack in Karbala occurred around sunset, just before the evening prayer. It took place a few hundred yards from the Imam Hussein shrine, one of the holiest houses of worship for Shiite Muslims.

Iraqi police said a woman wearing a suicide vest blew up in a street crowded with pedestrians and lined with outdoor cafes. A security guard stationed at an office of cleric Moqtada al-Sadr's organization said she screamed "God is great" three times before the bomb detonated.

The bomb killed 40 people and wounded 65 others, according to a U.S. military statement, citing Iraqi security forces in Karbala. A spokesman for the Karbala health office, Salim Kadhum, said 42 people died and 73 were injured.

Jassem Mohammed, 28, owns a nearby men's clothing store, whose windows shattered and ceiling collapsed around him. "It was just horrible," he said, "something seen only in movies."

Cheney, who arrived aboard a C-17 transport on the first stop of a 10-day tour of the Middle East, focused on recent security gains and praised Iraqi leaders for making progress toward political reconciliation. While he pressed them to approve a law governing the oil industry and to set provincial elections in October, he said the situation had already improved enough to show the invasion was justified.

"If you reflect back on those five years, it's been a difficult, challenging, but nonetheless successful endeavor," he said at a news conference with Ambassador Ryan C. Crocker and Army Gen. David H. Petraeus, the top U.S. commander in Iraq. "We've come a long way in five years, and it's been well worth the effort."

Cheney's argument that Saddam Hussein's Iraq was tied to Osama bin Laden's al-Qaeda came despite a Pentagon study last week that found "no smoking gun" to prove an "operational relationship." But the Weekly Standard, a conservative magazine that supports the war, published an article saying the report's executive summary oversimplified its findings, which it said bolster Cheney's case.

Cheney brought along Stephen Hayes, the article's author and a biographer of the vice president, who asked why the White House was not pressing its argument further. Cheney said he had long known that Hussein supported a range of terrorist groups and that the new report "pretty conclusively makes that case."

Noting that the report said there was no "operational" link between Iraq and al-Qaeda, he said it documented "extensive links with Egyptian Islamic Jihad," a group headed by bin Laden deputy Ayman al-Zawahiri, that later merged into al-Qaeda.

"Now was that a link between Iraq and al-Qaeda?" he said. "Seems to me pretty clear that there was."

Democrats in Washington leapt on Cheney's comments, comparing them to his prewar assertion that U.S. troops would be greeted as liberators and his 2005 declaration that the insurgency was in its "last throes." Senate Majority Leader Harry M. Reid (Nev.) said Cheney should instead figure out how "to find Osama bin Laden and al-Qaeda's senior leadership -- neither of whom are in Iraq."

Former congressman Lee H. Hamilton (D-Ind.), co-chairman of the bipartisan commission that investigated the Sept. 11, 2001, attacks and found "no operational relationship" between Iraq and al-Qaeda, said Cheney was parsing words to create a false impression.

"They just keep repeating it -- the vice president uses the word 'links,' " Hamilton said in an interview. "Nobody really denies that. The question is 'Was there an operational relationship?,' and there's no evidence of that."

The security gains Cheney hailed have prompted cautious optimism among Iraqis, according to the ABC poll. Fifty-five percent of those surveyed said their lives are "going well," compared with 39 percent last August. Thirty-seven percent said security over the past six months had remained the same, while 36 percent said it had improved and 26 percent said it had deteriorated. But the vast majority were still dissatisfied with access to electricity (88 percent), fuel (81 percent) and jobs (70 percent).

The Red Cross report likewise highlighted dire living conditions. Poor maintenance, insufficient fuel supplies, acts of sabotage and failure to conduct repairs threaten the electrical supply throughout Iraq, and many Iraqis rely on unsafe water sources, the report says.

The health-care system is in crisis because of shortages of supplies and hospital beds as well as a shrinking pool of Iraqi doctors, the report says. About 2,200 doctors and nurses have been killed and more than 250 kidnapped since 2003, it says, and 20,000 of the 34,000 doctors registered in Iraq in 1990 have left the country.

"The Iraqi health-care system is now in worse shape than ever," the report concludes. "Many lives have been lost because prompt and appropriate medical care is not available."

Although violence has subsided compared with a year ago, Iraq remains a dangerous place. Two U.S. soldiers were killed Monday when a bomb exploded on their vehicle north of Baghdad during a mission to clear a road of such explosives. The attack raised the number of U.S. soldiers who have died in Iraq to at least 3,990.

Baker reported from Washington. Special correspondents Saad Sarhan in Najaf, Naseer Nouri in Baghdad and Mohanned Saif Aldin in Samarra and staff writer Josh White in Washington contributed to this report.