Thirty-two thousand Boy Scouts and thousands of visitors cheered wildly and brandished U.S. flags as President Bush appeared Sunday at the National Scout Jamboree, bringing a buoyant end to the turbulent first week of a camp-out that began in tragedy.

In a brief speech to a sea of excited khaki- and olive-clad boys spread over a vast field at the Army base here, Bush urged the Scouts to continue serving their country and offered his condolences to the families of four Alaska Scout leaders electrocuted last Monday while setting up a dining tent.

"The men you lost were models of citizenship, leaders who stepped forward to serve a good and selfless cause," he said.

"You Scouts honor them by living up to the ideals of the Scouting they served," the president added.

As Bush took the stage beneath a massive Boy Scouts emblem, Scouts leapt up and erupted in applause. They were beyond ready to hear from Bush, who, by virtue of his job, is the honorary president of the nation's Boy Scouts and whose visit had been postponed twice.

After the cheers and chants of "U.S.A.! U.S.A.!" died down, Bush praised the Scouts for their community service, singling out troops from Louisiana who collected five tons of food for food banks and Scouts from Nebraska who made flags for soldiers in Iraq.

"I thank the Boy Scouts for serving on the front line of America's armies of compassion," said Bush.

The speech was open to visitors, and Scout officials said the total attendance was 75,000.

After Bush left, a hush descended as the crowd observed a moment of silence to honor the four Alaska Scout leaders.

Soon after, Kendell Call, 15, whose father, Larry Call, was injured in the accident, received a medal of honor for saving him. In an interview last week, Kendell's mother said the teenager "almost pulled him right back to life."

After Bush's speech, Daniel Bartell, 17, an Eagle Scout from New Albany, Ind., called the visit a "great honor" and "the greatest thing that has ever happened."

In a brief interview, the youth said he pressed forward when Bush approached the crowd after speaking. He just missed getting to shake hands, he said, but took a picture.

Andrew Foust, 16, of Troop 40 from York, Pa., who came for the day, said it was "awesome that the president recognizes all of the hard work, dedication and commitment that the Scouts have for our country."

"He encouraged us to be leaders someday," said Paul DeWys, 17, of Coopersville, Mich. Sterling Worrall, 14, and Daniel Metcalf, 13, both of the Dallas area, raved about the president's speech. "Most of us thought it was just going to . . . , " Sterling said. "Just drag on and on," Daniel said, completing the thought. "But it was very informational. . . . It hit the heart," Sterling said.

Several Scouts said they appreciated that the president seemed to pitch his talk directly to them, telling them that he had been a Cub Scout, citing the Scout oath and telling of members of his administration who had been Scouts.

Bush was scheduled to speak at the jamboree's opening show Wednesday. Inclement weather prompted him to cancel shortly before, and Scout officials called off the show. More than 300 Scouts and others who had waited for hours in sweltering heat in the arena suffered heat exhaustion, and more than 40 were taken to hospitals.

The show was rescheduled for Thursday, and Bush indicated that he would make it. But Scout officials canceled, saying the Scouts and a fatigued medical staff needed a chance to rejuvenate in the cooler temperatures that had arrived.

The jamboree had a heartbreaking first day. The four Alaska Scout leaders were killed after the central pole of a dining tent they were erecting touched an overhead power line. Grief was widespread. Two days of oppressive heat followed, keeping Scouts lethargic and leading to canceled events.

The jamboree ends Wednesday, but Sunday night's event was the closing show. The 10-day event that is held every four years has drawn Scouts from across the nation -- and several hundred from abroad -- for outdoor activities and learning.

At one point Sunday, a military helicopter made an emergency landing at the jamboree site, the Associated Press reported. Nobody was injured.

Tim Leech, 15, a Bush fan from Roseburg, Ore., suspiciously eyed the clouds a few hours before the evening show but stayed optimistic that the president would arrive. "Now my hopes are up again," he said.

Alex Silva, 12, of Kailua, Hawaii, wore his dress uniform all day, waiting until he and 150 other Scouts who had been picked by their Scoutmasters would be onstage with the president.

He called it a "once-in-a-lifetime opportunity."

Staff writers Hamil R. Harris and Martin Weil contributed to this report.

President Bush, greeting Boy Scouts onstage, praised the group for leading "America's armies of compassion."Thirty-two thousand Boy Scouts were joined by thousands of visitors as they cheered the president at Fort A.P. Hill.