Protesters who claim the vote was rigged clash with police for a second day. The government denies that two of the president's challengers are under house arrest.

TEHRAN — Iran's capital erupted in violence and civil disobedience for a second day Sunday, as protesters angered by what they consider rampant vote fraud in Friday's presidential election hurled rocks, set fire to storefronts and shouted anti-government slogans.

As security forces fought off the demonstrators, an assertive President Mahmoud Ahmadinejad defended his government- certified victory as the legitimate will of the people and derided the demonstrators as unimportant.

Ahmadinejad, speaking at a news conference, likened his detractors to angry soccer fans who commit a traffic violation leaving the stadium after a match. "He's going to be fined, but he's still a citizen of this country," he said.

Afterward, Ahmadinejad appeared before a massive rally in Tehran's Vali Asr square, where thousands of supporters waved red, white and green Iranian flags and banners with religious slogans.

Ahmadinejad suggested that he would not change course on major foreign and domestic issues that have made him a lightning rod for criticism from the West. He repeated his willingness to "debate" President Obama publicly at the United Nations and downplayed international concerns about Iran's nuclear research program, which Western nations believe is aimed at developing nuclear weapons and Iran says is for civilian purposes.

Ahmadinejad also rejected the possibility of an American or Israeli attack on Iran's nuclear facilities.

"Who dares to do such a thing today?" he said in response to a question from a reporter. "Who dares to even think about it? No power can even threaten Iran."

State news media quoted police officials as saying that they had detained nearly a dozen people who allegedly instigated protests and at least 160 opposition demonstrators.

Sunday's unrest drew to a close earlier than the previous day but appeared to have spread to some southern parts of the capital and drawn in more people.

At 9 p.m., supporters of moderate candidate Mir-Hossein Mousavi went on rooftops across the city and shouted into the darkness, "God is Great! Death to the dictator!" -- a dramatic gesture harking back to the days before the 1979 Islamic Revolution.

Fierce clashes erupted between supporters of Mousavi and security forces at the square near the Interior Ministry, where the election results had been certified, and around the main campus of Tehran University, a frequent scene of unrest in Iran's political and cultural battles. Plainclothes security officials rattling truncheons against the university guard railing stormed the Mousavi supporters and dispersed the crowds.

Around midnight in west Tehran's Ferdows neighborhood, residents took to the streets, chanting slogans against the president and setting trash cans on fire. In the Villa district in downtown Tehran, residents marched chanting, "We fight! We die! But we'll get our votes back."

The election commission swiftly declared Ahmadinejad the winner over Mousavi after a hotly contested race. But even before Friday's voting ended, Mousavi and another candidate, Mehdi Karroubi, had complained of massive vote-rigging.

When vote tallies were announced showing Ahmadinejad with more than 63% of the vote, rowdy riots and unrest erupted throughout the capital and in Esfahan, Tabriz, Orumieh, Rasht and Shiraz.

There were conflicting reports Sunday about whether Mousavi was under house arrest. Officials denied that he was, but Mashallah Shamsolvaezin, a confidant, said Mousavi and his wife, Zahra Rahnavard, were under house arrest and cut off from most communications.

Through a website, Mousavi called on supporters to refrain from violence and "harming themselves."

He also announced plans to formally appeal the election results through the Council of Guardians. But there seemed little likelihood that an appeal would succeed because the council is appointed by Ayatollah Ali Khamenei, Iran's top political and religious leader, who made a speech on state television strongly praising Friday's vote.

A Mousavi campaign official said his office had requested permission to hold a rally in Tehran today so he could make a speech to try to cool the passions of his supporters.

Another presidential contender, Mohsen Rezai, the sole conservative running against Ahmadinejad, said he recognized the legitimacy of the vote.

"A person who has become president through legal procedures is the president of all Iranian people," the former Revolutionary Guard commander said in a statement.

Western leaders have voiced concern about the unrest and allegations of fraud and civil liberties violations. But U.S. officials remained cautious, worried that their words could taint the opposition as American stooges.

Vice President Joe Biden said Sunday that the Obama administration would "wait and see" before drawing a conclusion about the events in Iran. Still, he expressed skepticism about the vote count.