KABUL—Afghan President Hamid Karzai lashed out at foreign interference and called for a ban on the private security companies that protect many Western installations here, in a speech that ratchets up recent tensions with the U.S. over two American-backed anticorruption agencies.

"We have the ability to rule and govern our country and we have our sovereignty. We hope that NATO countries and the U.S. pay attention," Mr. Karzai told a gathering of Afghan civil servants in a speech on Saturday. "No Afghan administration will be successful unless it lays off its foreign advisers and replaces them with Afghans."

The call to ban private security companies came a week after a convoy of DynCorp International, which provides security in Afghanistan under a U.S. State Department contract, was involved in a car accident that killed an Afghan civilian in Kabul. The accident sparked rioting and anti-American protests.

The 10 aid workers killed last week as they returned to Kabul from a remote part of the country didn't have a security detail.

The Afghan leader's defiant weekend speech came days after U.S. Secretary of State Hillary Clinton phoned Mr. Karzai to press him to live up to his anticorruption commitments, according to U.S. officials, warning that his recent attempt to weaken two U.S.-mentored antigraft agencies could endanger the chances of congressional approval for billions of dollars in aid to Afghanistan.