President Bush may have triumphed at home, but he was burned in effigy here Wednesday.

A noisy street demonstration marked the 25th anniversary of the student takeover of the U.S. Embassy, after which 52 Americans were held hostage for 444 days. Unlike past commemorations, this one appeared to be focused on the future and the potential for a major showdown with the United States during a second Bush term.

Bush and not Jimmy Carter, who was president during the 1979-81 hostage drama, was at the center of the protest. Three massive photographs of the president served as a backdrop for speakers who criticized U.S. foreign policy. The subtext throughout the protest was the escalating dispute between the United States and Iran over Tehran's nuclear energy program.

"Nuclear technology is our right, and we are not going to surrender our rights to the United States or Europe," vowed one of several banners waved by teenage schoolgirls in a crowd of thousands. The crowd gathered outside the sprawling former American compound, which is now a training center for Iraq's elite Revolutionary Guards military unit. The two-hour rally ended with a statement, read to roaring chants of "Allahu Akbar," or "God is great," that Iran would never give up its right to nuclear technology.

Iran says it wants to use nuclear power to meet the energy needs of a population that has more than doubled since the 1979 Islamic revolution. But the United States has charged that Iran is also developing a nuclear weapons capability, which the Bush administration has vowed to prevent. The U.S. military offensives in Iraq and Afghanistan, countries that share long, strategic borders with Iran, have sparked worries here that the United States may be considering some form of confrontation with Iran. That is one of several reasons that Iranians are increasingly interested in their country acquiring weapons capability, if not a bomb.

"If America is going to attack us, it's important to protect ourselves," said Shiva Mosapour, a 16-year-old high school student holding an enveloping black chador tight under her chin. Her assumption about Bush's intentions during his second term has been echoed by many in a younger generation that doesn't remember the U.S.-backed monarchy that was toppled in January 1979, months before the seizure of the U.S. Embassy.

Mohammed, 15, a high school sophomore with curly dark hair, played the role of Bush for the day. He was told by a demonstration organizer not to give his last name. Costumed in a giant, plastic-foam head of Bush, with ping-pong balls for eyes, Mohammed said he wanted to caricature the president because of his policies in Iraq and Afghanistan.

"What Bush says is nonsense about the reasons for attacks on other countries -- that he does it all in the name of democracy," he said. "Look how many people his decisions have killed in Iraq."

Older Iranians at the protest -- organized this year by such factions as the Islamic Coalition Party and the Revolutionary Guard that are increasingly powerful now that conservatives dominate Iranian politics -- found it hard to believe Bush won.

"Why did people vote for Bush when he brought such bloodshed to this region?" said Fatima Hoshmahd, 70, a homemaker who lost a son in the 1980-88 Iran-Iraq war. "Bush will bring America bad luck."

Amir Mohabian, political editor of the newspaper Reselaat, said in an interview, "Although the whole world was against Bush being elected, the American people voted for him. It shows that America is going to be isolated among global public opinion."

The 25th anniversary protest came as James H. Billington, the librarian of Congress, was in Iran on a cultural mission. Billington is the guest of the director of Iran's National Library and is in Iran to discuss expanding the U.S. collection of Iranian publications, according to a statement from his office. The State Department and White House both approved the visit, U.S. officials said.

For all the alarm over Bush's reelection, some Iranian political commentators suggested that Iran traditionally has ended up faring better under Republican administrations.

"Republicans have always had an interest in oil," said Saeed Lailaz, a columnist for the newspaper al Shargh. "So at times, Republicans can be more practical than Democrats in dealing with Iran. That was true even before the revolution."

Staff writer Dana Priest in Washington contributed to this report.

Thousands of Iranians rally near the former U.S. Embassy to mark the anniversary of the siege that kept 52 Americans hostage for 444 days.