President Obama’s nominee to become the new U.S. ambassador to Afghanistan told lawmakers Wednesday that the death of Osama bin Laden last month marked “an important step” toward core U.S. goals in the country but that more hard work lies ahead to prevent al-Qaeda from regaining its safe havens there.

In a confirmation hearing before the Senate Foreign Relations Committee, Ryan C. Crocker, a veteran diplomat called out of retirement to take over the difficult post in Kabul, said making progress in Afghanistan is hard but not “hopeless.”

He came under questioning from skeptical senators from both parties who advocate a reduced U.S. role in Afghanistan after a decade of involvement that has cost nearly $19 billion. The nominee argued that the United States must continue investing in the country to keep it from again becoming a haven for terrorists. He told the committee that “if Iraq was hard . . . Afghanistan in many respects is harder.” But that does not mean success there is “impossible,” he said.

Obama, meanwhile, spoke with Afghan President Hamid Karzai for about an hour by video teleconference Wednesday morning, covering topics including bin Laden’s death and recent civilian casualties from U.S. airstrikes. The White House said the two discussed the impact of the al-Qaeda leader’s death “on the fight against terrorism and on regional dynamics,” as well as the “transition to Afghan leadership for security,” among other subjects.

Obama “expressed his sorrow over tragic civilian casualties, most recently in Helmand province,” the White House said. It said he and Karzai noted that the radical Islamist Taliban movement bears responsibility “for the great majority of civilian losses,” but agreed that every loss of civilian life “undermines our mission that focuses on protecting the population.”

Crocker’s testimony came as the Foreign Relations Committee’s Democratic majority staff released a report calling on the Obama administration to rethink its Afghan assistance programs, saying that the hugely expensive U.S. nation-building effort has had limited success and may not survive an American withdrawal.

Sen. John F. Kerry (D-Mass.), the Foreign Relations Committee chairman, told Crocker in an opening statement that the current U.S. commitment in Afghanistan, “in troops and dollars, is neither proportional to our interests nor sustainable.” While the U.S. military has made gains against the Taliban in southern Afghanistan, “we have not yet made sufficient gains in the east, where the threat from insurgent groups based in Pakistan continues,” he said in his prepared remarks.

Kerry called for a “political settlement to end the war,” saying the United States should support the Afghan government as it tries to negotiate with insurgents “who are willing to cut an acceptable deal.” He also urged the administration to reexamine plans to build up the Afghan security forces. “Their ability to defend their country remains our ticket out of Afghanistan, but there are serious questions about their size, capability and sustainability,” Kerry said.

Sen. Richard G. Lugar (Ind.), the top Republican on the committee, said that addressing various threats — including terrorism, weapons of mass destruction, debt, energy and food prices — “will be much more difficult if we devote too many resources to one country that, historically, has frustrated nation-building experiments.”

He called on Obama to “put forward a new plan that includes a definition of success in Afghanistan based on U.S. vital interests and a sober analysis of what is possible to achieve.”

Despite nearly 10 years of U.S. investment following the ouster of the Taliban from power in Afghanistan in the wake of the Sept. 11, 2001, terrorist attacks, “we remain in a cycle that produces relative progress but fails to deliver a secure political or military resolution,” Lugar said in his prepared opening statement. “Undoubtedly, we will make some progress when we are spending more than $100 billion per year in that country. The more important question is whether we have an efficient strategy for protecting our vital interests that does not involve massive open-ended expenditures and does not require us to have more faith than is justified in Afghan institutions.”

Crocker, who reopened the U.S. Embassy in Kabul in January 2002 and subsequently served as ambassador to Pakistan and Iraq, stressed that the core U.S. goal in Afghanistan and Pakistan is to “disrupt, dismantle and defeat al-Qaeda and to deny it safe haven in those countries.” The killing of bin Laden in Pakistan in a May 2 raid by U.S. Navy SEALs was “an important step toward achieving this objective,” he said in prepared testimony, “but much work remains to be done to ensure that al-Qaeda can never again threaten us from Afghanistan, with the Taliban providing safe haven.”

He said that “we have made significant progress, but this progress is still fragile and reversible” and “enormous challenges remain,” including problems with governance, corruption, narcotics, economic development, employment and basic services such as education and health care.

“Failure in some of these areas can mean failure of the state and the creation of an environment in which our strategic enemies can regroup,” Crocker warned. “Making progress on these issues has been hard, and it will go on being hard. But hard does not mean hopeless.”

Crocker noted that, after helping Afghan Islamic fighters force Soviet troops to withdraw in 1989, the United States “walked away from Afghanistan . . . with disastrous consequences.” He added: “We cannot afford to do so again.” He quoted Secretary of State Hillary Rodham Clinton as vowing, “We will not repeat the mistakes of the past.”