The departing U.S. ambassador said Monday that talks with insurgent representatives are focusing on persuading them to join forces against Al Qaeda, hoping to take advantage of anger over attacks increasingly targeting Sunnis as well as Shiites to isolate the terror network.

In a farewell news conference, Zalmay Khalilzad said he was cautiously optimistic that Iraq was heading in the right direction. But he warned Iraqi leaders that U.S. voters were increasingly impatient with the war and urged them to step up efforts to bring the country's fractured ethnic and religious communities together to stop the violence.

"In my view, though difficult challenges lie ahead and there is a long way to go, Iraq is fundamentally headed in the right direction and success is possible," he said, pointing to a nearly 25 percent reduction in violence during a six-week old security crackdown in Baghdad and progress on the economic fronts.

He acknowledged, however, that he was leaving his post after 21 months with a litany of unfinished business, including an oil law that is waiting for parliamentary approval, and he called on Iraqi leaders to make progress on legislative and political measures aimed at bringing disaffected Sunnis into the political fold.

"The members of the coalition as well as other countries have made enormous sacrifices to give Iraqis a chance to build a stable and democratic order," he said. "Iraqis must not lose this opportunity and they must step up and take the tough decisions necessary for success."

The Afghan-born diplomat, who has been nominated by U.S. President George W. Bush as U.S. ambassador to the United Nations, said agreements to disarm insurgent groups that had opposed the political process but were not dedicated to violence were part of the process. But he ruled out any contacts with Al Qaeda in Iraq, which has been blamed in many of the high-profile suicide bombings that have killed hundreds.

"We have had discussions with those groups," Khalilzad told reporters in Baghdad. "They are continuing to take place and I think one of the challenges is how to separate more and more groups away from Al Qaeda."

U.S. officials have been working for years to encourage dialogue with Iraqi groups — including major Sunni insurgent groups, except Al Qaeda. Khalilzad has said previously that U.S. officials have met with people linked to the Sunni insurgency, and America's new top general in Iraq, Gen. David Petraeus, said earlier this month that such dialogue was necessary because force alone cannot halt the violence.

But Khalilzad said Monday that the talks have shifted from "unreasonable demands" by the groups for a U.S. withdrawal to forming an alliance against Al Qaeda. He said the effort already had gained support among tribal leaders and even some insurgent elements in Sunni Arab areas who have grown increasingly frustrated with the violence that has killed more Iraqi civilians than U.S. forces.

"Iraqis are uniting against Al Qaeda," he said. "Coalition commanders have been able to engage some insurgents to explore ways to collaborate in fighting the terrorists. These insurgents are also in touch with the government seeking reconciliation and cooperation in the fight against the al-Qaida terrorists and joining the government in a reconciliation program."

Khalilzad — who will be replaced by Ambassador Ryan Crocker, who is transferring to Iraq after two-and-a-half years in Pakistan — said the U.S. hopes to build on that momentum.

"We have talked to groups who have not participated in the political process who have ties with some of the insurgent groups who are reconcilable insurgents," he said. "The terrorists are irreconcilable. There cannot be reconciliation with Al Qaeda. They have to be brought to justice, but there are groups that resisted the democratic change, the change in Iraq.

"It is our goal to get those groups to be reconciled. to accept to embrace this new Iraq and that will be a victory, a success for the change that has taken place," he added.

Khalilzad, who has seen a massive increase in sectarian violence during his tenure, declined to provide details about the contacts with insurgent groups, citing security concerns.

His comments came as debate heated up in the U.S. over a Democratic push for a bill that would set a 2008 date for the withdrawal of American forces from Iraq. The House narrowly passed a bill Friday that would pay for wars in Iraq and Afghanistan this year but would require that combat troops come home from Iraq before September 2008 — or earlier if the Iraqi government did not meet certain requirements. Bush has made clear he will veto any such legislation.

The ambassador said Iraqi leaders should take it as a warning.

"I know that we are an impatient people, and I constantly signal to the Iraqi leaders that our patience, or the patience of the American people, is running out," he said.

Khalilzad's remarks coincided with the eruption of sectarian violence in a string of mixed Sunni-Shiite towns south of the capital Monday and over the weekend.

In Iskandariyah, 30 miles south of Baghdad, authorities slapped an indefinite curfew after two people were killed and two others wounded in sectarian clashes sparked by an attack Monday by suspected Shiite militants on a Sunni mosque, police said.

Iraqi and U.S. forces sealed off the area where the mosque is located, but clashes erupted elsewhere in the town.

The mosque was slightly damaged by rocket propelled grenades fired by the assailants.

In Mahaweel, a mainly Shiite town 35 miles south of Baghdad, a bomb planted near a Sunni mosque went off Monday morning, damaging the building but causing no casualties, police said.

The targeting of the mosques came one day after suspected Shiite militants attacked a Sunni mosque in Haswa, a town near both Iskandariyah and Mahaweel. The attack was in apparent retaliation for a suicide truck bombing against a Shiite mosque that killed 11 people on Saturday, also in Haswa.

Khalizad accused Al Qaeda of fueling the violence by using car bombs to provoke Shiite groups into targeting Sunnis, but he warned the group also was targeting Sunnis themselves in an effort to derail the Baghdad security plan. A suicide bombing also seriously wounded Iraq's Sunni Deputy Prime Minister Salam al-Zubaie on Friday in his heavily guarded compound in the capital.

"Certainly they are going after Sunni figures and Sunni areas as well so they've declared war on both sects now," the ambassador said.

In all, at least 35 people were killed or found dead in Iraq, including two civilians in a suicide car bombing against an Iraqi checkpoint in central Baghdad. The bullet-riddled bodies of 15 men also were found in different parts of the capital — apparent victims of so-called sectarian death squads.