President Bush and Iraq's interim prime minister, Ayad Allawi, pledged yesterday that Iraq's elections would take place in January despite escalating violence, as U.S. officials began to suggest the first democratic poll might not take place in all parts of the country.

With the elections now seen as the barometer of Iraq's transition to democracy, the United States and Iraq appear to have decided that an imperfect poll would be better than delaying it because of an insurgency that has claimed control of key cities and provincial capitals in the Sunni Triangle north of Baghdad.

In a speech before a joint meeting of Congress, Allawi conceded that the elections "may not be perfect, may not be the best elections that Iraq will ever hold" and "won't be the end of the journey toward democracy." But he vowed that Iraq would proceed on schedule in defiance of both skeptics and insurgents.

"I know that some have speculated, even doubted, whether this date can be met. So let me be absolutely clear," said Allawi, the first Iraqi leader to visit Washington since King Faisal II in August 1952. "For skeptics who do not understand the Iraqi people, they do not realize how decades of torture and repression feed our desire for freedom. For every step of the political process to date, the courage and resilience of the Iraqi people has proved the doubters wrong."

Defense Secretary Donald H. Rumsfeld said yesterday that Iraq could opt to conduct partial elections, with most of the country going to the polls to elect representatives for a new national assembly in January but other areas facing a delayed vote if stability in major cities is not established by January.

"Let's say you tried to have an election and you could have it in three-quarters or four-fifths of the country. But in some places you couldn't because the violence was too great. Well, so be it," Rumsfeld said at a Senate Armed Services Committee hearing. "Nothing's perfect in life. So you have an election that's not quite perfect. Is it better than not having an election? You bet."

The timing of the elections has recently become a focal point, with U.N. officials suggesting last week that they should be delayed if the insurgency -- flaring violence by a combination of loyalists to former president Saddam Hussein, foreign fighters and Muslim extremists allied with Abu Musab Zarqawi -- prevents a fair nationwide vote.

Yesterday's visit by Allawi was a carefully orchestrated series of meetings that administration officials hope will ease concerns in Congress about the U.S. mission in Iraq and provide a vivid endorsement of Bush's Iraq strategy at a key moment in the presidential campaign.

Bush warned that terrorist violence could indeed escalate as the election draws near, but both men pledged to be resolute.

"My message is that we will stay the course and stand with these people so that they become free," Bush told reporters in the Rose Garden, with Allawi at his side. "If we stop fighting the terrorists in Iraq, they would be free to plot and plan attacks elsewhere, in America and other free nations," he said.

Using similar language, Bush and Allawi blamed the media for focusing too much on violence in Iraq and too little on the progress made since Hussein's ouster. "On television sets around the world, we see acts of violence," Bush said. "Yet, in most of Iraq, children are about to go back to school, parents are going back to work and new businesses are being opened."

In his address to Congress, Allawi praised U.S. troops for their sacrifice in Iraq, and said the interim government and U.S.-led coalition were winning the struggle against insurgents despite recent violence and disturbing turns, such as the beheadings of two American contractors by militants loyal to Zarqawi. "It's a tough struggle with setbacks, but we are succeeding," he said.

Allawi also asserted that the insurgency is "destructive but small" and that it does not resonate with the vast majority of the Iraqi people, who are now "emerging from the dark ages of violence, aggression, corruption and greed."

Allawi received several ovations during his speech. But reaction afterward was mixed, almost completely along partisan lines, reflecting that Iraq has become the most contentious issue in this election season.

House Democratic Whip Steny H. Hoyer (Md.), said that he appreciated Allawi's visit to Congress, but that it did not allay serious concerns.

"The violence in Iraq is increasing, 'no-go' zones full of insurgents have been established in many major cities, only 5 percent of U.S. reconstruction money has been spent, and the January elections that are essential to our success are dangerously close to not happening," he said. "President Bush and most Republicans either don't understand or refuse to admit that simply staying the course is not enough to win."

The Democratic presidential nominee, Sen. John F. Kerry (Mass.), said in Ohio that Bush and Allawi "are here obviously to put their best face on the policy, but the fact is that the CIA estimates, the reporting, the ground operations and the troops all tell a different story."

Iraq experts were also wary of the rosy portrait of the country 17 months after the war's end. "The situation in Iraq needs a great deal more than a visit from Prime Minister Allawi and more election-oriented reassurances," said Anthony H. Cordesman of the Center for Strategic and International Studies. "We need substance, not more empty reassurances and sound bites of rhetoric."

Some congressional staff members and Iraq experts also challenged Allawi's assertion that 14 or 15 of Iraq's 18 provinces are "completely safe" and that the others have only "pockets of terrorists." U.S. troops have come under varying degrees of attack in at least six provinces in recent weeks, including Baghdad, where as much as 25 percent of the Iraqi electorate resides, and Anbar, Diyala, Salahuddin, Kirkuk and Nineveh.

But Iraq does not need additional U.S. troops, Allawi said, adding that the real emphasis should be on training more Iraqis.

Former secretary of state Henry A. Kissinger, who sat next to Allawi at dinner at the United Nations on Tuesday, said, "This is a very difficult period, but we should make every effort to stick to the schedule that has been announced." Allawi, he said, "seemed to think he could meet that schedule and achieve both security and election. I am not in a position to judge that, personally, but he seemed to me serious and dedicated. We should make every effort to support him."

Interim Iraqi Prime Minister Ayad Allawi acknowledges applause after speaking to a joint meeting of Congress. Behind him, from left, are House Parliamentarian John Sullivan, Vice President Cheney and House Speaker J. Dennis Hastert. Allawi also met with President Bush and reporters. Interim Iraqi Prime Minister Ayad Allawi meets with members of Congress after speaking to a joint meeting at the Capitol.