KABUL, Afghanistan (AP) — U.S. Sen. John Kerry told the president of Afghanistan on Tuesday that his efforts to battle corruption were crucial if he wants to retain the support of U.S. taxpayers at a time when more American troops are dying in the war.

Kerry's two meetings with President Hamid Karzai came at a time when U.S. lawmakers are increasingly doubtful that the military effort can succeed without a serious campaign against bribery and graft that have eroded the Afghan people's trust in their government.

"I think that in the next days, the government of Afghanistan's response to anti-corruption efforts are a key test of its ability to regain the confidence of the people and provide the kind of governance that the American people are prepared to support with hard-earned tax dollars and with most importantly, with the treasure of our country — the lives of young American men and women," Kerry told reporters.

"If we have knowledge of things that we know are happening and the (Afghan) government doesn't respond to it, it's going to be very, very difficult for us to look American families in the eye and say, 'Hey, that's something worth dying for.'"

Last October when Kerry was in Kabul, he played an instrumental role in persuading Karzai to accept a run-off vote after a fraud-plagued presidential election. This trip comes just days after the arrest of one of Karzai's top advisers, Mohammad Zia Salehi, for allegedly accepting a car in exchange for his help in exerting pressure on Afghan officials to ease off in another corruption case.

U.S. officials see Salehi's arrest as a test case of Karzai's willingness to fight corruption and are waiting to see if the president will impose restraints on corruption probes being conducted by the Major Crimes Task Force and the Sensitive Investigative Unit, which are mentored by U.S. and British law enforcement officials.

"I'm not going to stand up and defend for one instant a policy that is based on supporting a corrupt government — if that's what it wound up being," Kerry said. "But that's the test right now, that's why I'm here. I think President Karzai and his government need to understand that there is no patience for endless support for something that doesn't meet higher standards with respect to governance."

Kerry said he believes Karzai knows the American public is tiring of the nearly 9-year-old war that has claimed the lives of more than 1,200 U.S. service men and women. He knows that Republicans and Democrats alike are anxious about what is happening and not happening in Afghanistan, Kerry said.

At a recent hearing of the Senate Foreign Relations Committee, which Kerry chairs, the panel's ranking Republican, Richard Lugar of Indiana, said there was a "lack of clarity" about U.S. war goals. And Richard Holbrooke, the Obama administration's special envoy for Afghanistan and Pakistan, said that while there were "significant elements of movement forward in many areas," he does not yet see a "definitive turning point in either direction."

At his first meeting with Karzai on Tuesday, Kerry said the Afghan president noted issues he wants the U.S. to address, including reducing the American footprint in the nation and refraining from setting up programs or institutions that should be handled by Afghan government. More urgently, Karzai expressed concern about Pakistan's involvement in Afghanistan, Kerry said.

A statement released by the Afghans said Karzai recently sent a letter to President Barack Obama saying the war strategy needed to be reviewed. Without mentioning neighboring Pakistan, Karzai wrote that there needs to be more focus on the "roots and sanctuaries" of terrorism outside Afghanistan instead of only fighting the war in Afghan homes and villages.

Kerry said the U.S. shared Karzai's concerns about insurgents who direct attacks from across the border in Pakistan.

"Look, we are still dismantling and/or fighting threats, or thwarting them, that have come from the same people that attacked us in 2001," Kerry said. "And we still know that they're out there — some of them here, most of them in western Pakistan, to the best of our knowledge, some in the Arabian Peninsula and in Africa — and they continue to threaten. And you just can't take that lightly. So that's where we are."

Karzai has become increasingly vigorous in exerting its authority in affairs of his nation.

Just as Kerry was arriving, the Afghan government surprised the U.S. by ordering tens of thousands of private security contractors to cease operations in Afghanistan by the end of the year. The U.S. and its allies rely heavily on security companies to guard supply convoys, installations and development projects.

But complaints have mounted that the firms are poorly regulated, reckless and effectively operate outside local law.

Kerry said he agreed that it was important to reduce the role of security contractors but experts would have to decide whether a four-month timetable was appropriate in a nation where violence is on the rise.

Hours after the decree was issued, the U.S. Embassy expressed concern about "unintended consequences" about the timetable, saying it could delay U.S. reconstruction and development assistance efforts.