KABUL—America's fraught ties with Afghanistan suffered a jarring blow Sunday, when Afghan President Hamid Karzai said during a visit by the new U.S. defense secretary that the Taliban were killing Afghan civilians "in service to America."

The remarks, in a televised speech hours before Mr. Karzai's meeting with U.S. Defense Secretary Chuck Hagel, capped a series of confrontations between the Afghan president and the U.S. over his demands to assert Afghan sovereignty and curtail American military operations.

Mr. Karzai met Mr. Hagel a day after suspected Taliban suicide bombers killed at least 18 people at the Ministry of Defense in Kabul and in the eastern province of Khost.

In his address, Mr. Karzai said the U.S. doesn't want to leave the country after the NATO coalition's mandate expires at the end of 2014 because it covets Afghan resources and is talking with Taliban leaders behind his back.

"Taliban are every day in talks with America, but in Kabul and Khost they set off bombs to show strength to America," Mr. Karzai said. "The bombs that went off in Kabul and Khost yesterday were not a show of power to America, but were in service to America…It was in the service of foreigners not withdrawing from Afghanistan."