The US-Iraqi security pact now before parliament calls for US forces to leave Iraq's cities by June 30 in recognition of an improved security climate, but the deadline poses a key test for Iraqi forces in places like Baghdad and the northern city of Mosul where attacks still occur daily. It is a gamble that Prime Minister Nouri al-Maliki, emboldened by recent military successes, is willing to take - partly because of growing confidence in the capabilities of Iraqi forces. US Ambassador Ryan Crocker described the security gains as "superlative" at a Monday signing ceremony of the agreement with Foreign Minister Hoshyar Zebari. The pact, overwhelmingly approved by the Cabinet, was read to lawmakers in the first stage of parliament's procedure for approving the bill. A vote on the pact, which allows US forces to remain in Iraq through 2011, is scheduled for Nov. 24. It has a good chance of passing since al-Maliki's Cabinet is made up of the same parties that dominate the 275-seat legislature. If approved, it goes to President Jalal Talabani, a Kurd, and his two deputies for ratification. Talabani and Adel Abdul-Mahdi, his Shiite vice president, support the deal. The second deputy, Sunni Arab Tariq al-Hashemi, has said he wanted it put to a vote in a national referendum. He is unlikely to veto it if his longtime demands for more political clout for the Sunni Arab minority are met. Under the agreement, US forces must also grant Iraqi authorities extensive power over the operations and movements of American forces. The deal would replace a UN mandate governing their presence in Iraq that expires Dec. 31. White House press secretary Dana Perino defended the deal even though it includes a timeline for U.S. troop withdrawals - a point that President George W. Bush had long opposed as a sign of defeat in the war that began in 2003. "We just keep getting success after success on the security front in Iraq," Perino said. "And when you work with a partner on a negotiation, you have to concede some points." Adm. Mike Mullen told a Pentagon news conference that he has consulted the top US commanders in Iraq and that they all believe the agreement allows enough time for the Iraqis to be ready to defend themselves. Neighboring Syria, a longtime US adversary, blasted the pact, saying it rewarded the Americans. But Iran, a sworn US enemy that had been a bitter critic of the pact, took a surprisingly positive stand. Iran's judiciary chief, Ayatollah Mahmoud Hashemi Shahroudi, said the Iraqi Cabinet acted "very well" in approving the pact. The Web site of Iran's state television quoted him as saying he hoped the US will withdraw its troops within the time specified in the deal. Although there has been no word from the pact's harshest Iranian critic, hard-line President Mahmoud Ahmadinejad, the shift in Iran's position may be a reflection of Iran's hopes of improved relations with the United States after President-elect Barack Obama takes office Jan. 20. "Iran is now looking for talks with the US and is trying to reduce tensions ... and Iraq and the security deal are the most visible example of change in Iran's attitude toward America," said Vali Nasr, a prominent US-based expert on Shiite affairs. Iran sees the continued US presence in Iraq as a threat to its security and is sure to draw satisfaction from Obama's pledge to begin withdrawing troops from Iraq when he takes office. "As soon as I take office, I will call in the joint chiefs of staff, my national security apparatus, and we will start executing a plan that draws down our troops, particularly in light of the problems that we're having in Afghanistan, which has continued to worsen," he said in an interview Sunday on CBS' "60 Minutes." US and Iraqi officials acknowledge that the capabilities of Iraqi security forces have been improving, but doubts persist on whether they have in place a reliable logistical support network, enough discipline and the willingness to operate above the sectarian bias that defines political life in Iraq. Their test will be all the more difficult because recent security gains are thought to be fragile and continued attacks by al-Qaida and other insurgent groups in Baghdad, Mosul and in much of central and northern Iraq could undermine those hard-won gains. "I will tell you that the Iraqi army today ... has got a tremendous amount of confidence in themselves and is doing more and more each and every day that we work with them," US Army Col. John Hort, who commands US troops in northeastern Baghdad, said in a videoconference with Pentagon reporters. Renewed doubts about the security forces came Sunday from a senior politician from the once-dominant Sunni Arab minority. Addressing a news conference, Adnan al-Dulaimi said Iraq's army must mirror Iraq's religious and ethnic diversity, a thinly veiled reference to the Shiite domination of the force. The Iraqis, however, will not be entirely alone in the cities come July. The US forces would be withdrawn to outlying bases, and the agreement entitles the Iraqis to request the help of the Americans when they need it in the face of a major security threat. US military personnel were expected to continue training the Iraqis until their last day here: Dec. 31, 2011. U.S. officials said the pact was testimony to the improved capability of Iraq's forces and security gains made in the past year, thanks to the dispatch of 30,000 additional US troops in 2007, or the "surge"; a Sunni revolt against al-Qaida militants; and a cease-fire by a powerful Shiite militia. "Had it not been for the success of the surge, there would have been no possibility of the kinds of discussions and ultimately the agreement which we reached on the issue of dates as well as many other provisions," said one senior U.S. official in Baghdad who requested anonymity in exchange for discussing the pact. Sunday's Cabinet approval of the agreement came after a major hurdle was removed with Iraq's top Shiite cleric, Grand Ayatollah Ali al-Sistani, indicating to emissaries from al-Maliki that he would not object to the pact if parliament passed it with a comfortable majority. Al-Sistani enjoys enormous support among Iraq's Shiites and could have buried the deal had he spoken against it. "Al-Sistani's nod accorded the deal Shiite legitimacy and safeguarded Shiite unity," said Mustafa Alani, an expert on Iraqi affairs from the Dubai-based Gulf Research Center. Senior al-Maliki aides said the deal's chances were also helped by Washington's favorable response to two changes requested last week by the prime minister. They said U.S. negotiators in Baghdad granted one that made it impossible for U.S. troops to search Iraqi homes during routine security sweeps without a court order and the knowledge of Iraqi authorities. The negotiators initially turned down the second request for removing ambiguous language that could have allowed U.S. forces not to adhere to a June 30 deadline for their withdrawal from cities. But al-Maliki was granted the second request when he wrote to Bush Nov. 14, according to the aides, who spoke on condition of anonymity because they were not authorized to discuss the negotiations.