WASHINGTON - President Bush urged Iraq's citizens and nations working to rebuild the war-torn country not to lose their will after a truck bomb ripped through United Nations headquarters in Baghdad yesterday, killing 20 people, including the top U.N. envoy and other humanitarian workers.

"The civilized world will not be intimidated," Bush insisted, "and these killers will not determine the future of Iraq."

In a hastily arranged appearance in a helicopter hangar on his ranch in Crawford, Texas, Bush reacted to the deadly attack with a vow to "persevere through every hardship."

"Terrorists are testing our will," he said. "Across the world, they are finding that our will cannot be shaken."

The president learned of the attack while on a nearby golf course. Displaying a sense of urgency not evident in the aftermath of other recent guerrilla attacks, he abruptly halted his game and rushed back to the ranch, changing into a coat and tie and delivering his four-minute statement. He took no questions.

At the ranch, Bush quickly telephoned L. Paul Bremer III, the American civilian administrator for Iraq, and directed him to offer any needed assistance in rescue and recovery efforts.

Bush said he called U.N. Secretary-General Kofi Annan to discuss "the personal loss the U.N. has suffered" as well as "the vital work in Iraq that continues." A White House spokesman said Bush, in his call to Annan, "stressed the importance of the U.S., the U.N. and the coalition continuing to work together" in Iraq.

As the president expressed resolve, a U.N. spokesman said the world body was reassessing the security risks to its personnel assisting in reconstruction efforts in Iraq.

In recent weeks, guerrilla violence has appeared more organized and sophisticated, targeting water and power supplies, oil pipelines, and other sites symbolic of the U.S.-led reconstruction effort. Two weeks ago, a car bomb killed 19 people at the Jordanian Embassy in Baghdad.

The persistent attacks have claimed American lives and complicated efforts by Bush to point to Iraq as a major foreign policy success.

Bush branded those responsible for yesterday's suicide bombing in Baghdad as "enemies of the civilized world," and condemned them for attacking U.N. personnel and civilians taking part in "a purely humanitarian mission." The president indicated that the progress made in rebuilding the country has made terrorists more desperate to derail it.

"The terrorists want to return to the days of torture chambers and mass graves," Bush said. "The Iraqis who want peace and freedom must reject them and fight terror. And the United States and many in the world will be there to help them."

Yesterday underscored how quickly events on the ground can change the tenor of a day for a commander in chief. On his way to the golf course, Bush stopped at a gas station in tiny Crawford to tell reporters that he was "pleased" that coalition forces had earlier in the day captured Hussein's one-time vice president in Iraq.

Hours later, his golf game was cut short on the 12th hole by news of the bloody attack in Baghdad. And only hours after that, Bush received word of a deadly bombing in Jerusalem that killed at least 18 people and threatens to crumple the "road map" to Middle East peace that he has tried to implement even as he manages the increasingly complex aftermath of the Iraq campaign.

Since Bush declared major combat operations over in Iraq on May 1, polls show, there has been a drop in the percentage of Americans who believe the war was justified.

Asked in a CBS News poll released last week whether the war was worth the loss of American lives and other costs, 46 percent of respondents said it was worth it while 45 percent said it was not. Forty-three percent said events in Iraq are "out of U.S. control," compared with 45 percent who said they are "in control."

A majority of Americans say in opinion polls that they retain confidence in Bush's foreign policy. Analysts have deemed his handling of the war on terrorism his strong suit, warning of political risks for the president if that support erodes substantially.

Yesterday, a supporter of Bush's Iraq policy, Republican Sen. John McCain of Arizona, called for more troops to help bring stability and criticized the administration in two television interviews from Baghdad, suggesting that it was not leveling with the American people about the human and financial costs of the effort.

"I believe people will support the president," McCain said on CNN, "when they are told what's at stake here and what is necessary."

Earlier, before learning of the attack on U.N. personnel, McCain used stronger language, telling NBC, "We may have misled the American people by telling them basically that it was over when the hardest part, the imposition of peace and democracy, still lay ahead of us."

Sen. Bob Graham of Florida, a Democrat seeking the presidency, called on Bush to tell Americans how he plans to stabilize Iraq. Graham said Bush failed to offer the country an honest assessment of the potential costs of the war before he ordered the invasion of Iraq.

"The president failed in a fundamental element of leadership to let the American people know before the war in Iraq what it meant, what the consequences would be in terms of casualties, duration of occupation and cost," Graham said.

Stephen Hess, a Brookings Institution scholar who was a White House aide during the Eisenhower and Nixon administrations, said it would be premature to call the attack yesterday a political setback for Bush. He said that a guerrilla attack one day could be followed the next by a piece of good news for the president. Hess also noted that the violence in Iraq was fading in and out of the headlines.

"Two weeks ago, it was all Arnold Schwarzenegger, and you could not find any Iraq news at all," Hess said. "And last week, it was 50 million people blacked out."

While Democrats have begun to attack Bush aggressively for his handling of Iraq, Hess said, many middle-of-the-road voters still support the campaign in Iraq and the war on terror generally.

Even if more-liberal voters are punishing the president, Hess said, his foreign policy for the moment remains popular "in mainstream West Virginia," a bellwether state in presidential politics.