Defense Secretary Chuck Hagel encountered political tension with the Afghan president and a series of security problems during his first visit to Afghanistan as Pentagon chief, but he met privately with President Hamid Karzai and says they discussed the key issues. 
 
 U.S. Secretary of Defense Chuck Hagel, second left, walks with Afghan Brig. Gen. Aminullah Patyani, left, commander of the Kabul Military Training Center, upon his arrival at the facility in Kabul, Afghanistan,... (Associated Press) 
 
 Afghan President Hamid Karzai delivers a nationally televised speech about the state of Afghan women in Kabul, Afghanistan, Sunday, March, 10, 2013. Karzai on Sunday accused the Taliban and the U.S. of... (Associated Press) 
 
 U.S. Secretary of Defense Chuck Hagel walks with U.S. Ambassador to Afghanistan James Cunningham, left, and General Joseph Dunford, Commander of the International Security Force, upon Hagel's arrival... (Associated Press) 
 
 U.S. Secretary of Defense Chuck Hagel, center left, shakes hands with a female Afghan non-commissioned officer under training, during his visit to the Kabul Military Training Center in Kabul, Afghanistan,... (Associated Press) 
 
 Afghan President Hamid Karzai speaks during a nationally televised speech about the state of Afghan women in Kabul, Afghanistan, Sunday, March, 10, 2013. Karzai on Sunday accused the Taliban and the U.S.... (Associated Press) 
 
 U.S. Secretary of Defense Chuck Hagel, center, talks with members of the U.S. Army and Marines during his visit to the Kabul Military Training Center in Kabul, Afghanistan, Sunday, March 10, 2013. Hagel... (Associated Press) 
 
 U.S. Secretary of Defense Chuck Hagel, center, poses for a picture with members of the U.S. Army and Marines during his visit to the Kabul Military Training Center in Kabul, Afghanistan, Sunday, March... (Associated Press) 
 
 U.S. Secretary of Defense Chuck Hagel, left, is greeted by members of the U.S. Army and Marines during his visit to the Kabul Military Training Center in Kabul, Afghanistan, Sunday, March 10, 2013. Hagel... (Associated Press) 
 
 U.S. Secretary of Defense Chuck Hagel, left, meets with Afghanistan's Interior Minister Ghulam Mujtaba Patang at the ISAF (International Security Assistance Force) headquarters in Kabul, Sunday, March... (Associated Press) 
 
 Hagel says he understands that Karzai faces political pressures as the war winds down. 
 
 "I think he understands where we are and where we've been, and hopefully where we're going together," Hagel told reporters, but he declined to detail their talks. 
 
 Hagel is disputing Karzai's accusations that the U.S. and the Taliban are working in concert to show that violence in the country will worsen if most coalition troops leave. 
 
 The top U.S. commander in Afghanistan, Gen. Joseph Dunford, also rejected the charges Karzai made Sunday as "categorically false." 
 
 But the accusations were just the latest in a series of disputes that have frayed relations between the two nations as the U.S. works to wrap up the war and turn the country's security over to the Afghans. 
 
 Speaking to reporters soon after Karzai made the comments, Dunford said the Afghan leader has never expressed such views to him but said it was understandable that tensions would arise as the coalition balances the need to complete its mission with the Afghans' move to exercise more sovereignty. 
 
 "We have fought too hard over the past 12 years, we have shed too much blood over the past 12 years, we have done too much to help the Afghan security forces grow over the last 12 years to ever think that violence or instability would be to our advantage," said Dunford. 
 
 Dunford's comments came soon after U.S. officials canceled a news conference with Hagel and Karzai because of a security threat _ just a day after a suicide bomber on a bicycle struck outside the Afghan Defense Ministry, killing nine Afghan civilians and wounding 14 others. Hagel heard the explosion from the safe location where he was meeting with Afghan officials but was never in danger. 
 
 The security problems compounded a series of flare-ups in recent weeks, including a dispute that has stalled the transfer of a U.S. prison to Afghan authority as well as Karzai's order to expel U.S. special operations forces out of Wardak province, which lies just outside the capital, because of allegations that Afghans working with the commandos were involved in abusive behavior. 
 
 Hagel said he's known Karzai since soon after the U.S. invasion in late 2001, adding that such extended relationships can often be beneficial, especially when dealing with complicated issues. 
 
 The U.S. and Afghan leaders are in the midst of negotiations over the long-term presence of American forces in Afghanistan beyond the end of 2014, when all combat troops are scheduled to leave. 
 
 U.S. officials would not provide details on the security concerns that led to canceling the news conference. They spoke on condition of anonymity because they weren't authorized to discuss the matter publicly. But Pentagon press secretary George Little said the cancellation was not due to Karzai's earlier comments about the U.S. and the Taliban. 
 
 During a nationally televised speech, Karzai said two suicide bombings that killed 19 people on Saturday _ the one outside the Afghan Defense Ministry and the other near a police checkpoint in eastern Khost province _ show the insurgent group is conducting attacks to help show that international forces will still be needed to keep the peace after their current combat mission ends in 2014. 
 
 "The explosions in Kabul and Khost yesterday showed that they are at the service of America and at the service of this phrase: 2014. They are trying to frighten us into thinking that if the foreigners are not in Afghanistan, we would be facing these sorts of incidents," he said during the speech about the state of Afghan women. 
 
 Karzai is known for making incendiary comments in his public speeches. And Dunford on Sunday said that some of the recent disputes between the U.S.-led coalition and Afghan leaders "strike at the heart of sovereignty" and could be more political in nature. He said Karzai may be doing what he needs to do to communicate with the Afghan people and their political leaders outside the government. 
 
 That argument also resonated with Hagel, a former Republican senator from Nebraska. 
 
 "I was once a politician so I can understand the kind of pressures that especially leaders of countries are always under," Hagel said. "I would hope that, again, we can move forward, and I have confidence we will, and deal with these issues." 
 
 Dunford rejected the suggestion that the recent friction reflects erosion in the U.S. relationship with Afghanistan. 
 
 "We do not have a broken relationship, we do not have a lack of trust," said Dunford, adding that none of the political dust-ups have bled over into his dealings with his Afghan security force counterparts. He said efforts to train and advise the Afghan security forces have continued and that plans for them to be in the lead for security across the country later this summer are on track. 
 
 ___ 
 
 Associated Press writers Heidi Vogt and Rahim Faiez contributed to this report. 
 
 ___ 
 
 Follow Lolita C. Baldor on Twitter: http://twitter.com/lbaldor ||||| 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." 
 
 U.S. Marine Gen. Joseph Dunford, who took command of coalition forces last month, called Mr. Karzai's charges "categorically false." 
 
 "We have fought too hard over the past 12 years, we have shed too much blood over the last 12 years, we have done too much to help the Afghan security forces grow over the last 12 years to ever think that violence or instability would ever be to our advantage," he said. 
 
 Mr. Karzai's remarks blindsided American officials who had hoped to use Mr. Hagel's two-day visit, his first overseas trip as defense secretary, to shore up fragile relations with the Afghan president as the U.S. ends its longest foreign war. 
 
 Though most of the 66,000 U.S. troops now in Afghanistan are slated to go home next year, the U.S. hopes to leave behind an advisory and counterterrorism force that would support the Afghan government after 2014. 
 
 Enlarge Image Close European Pressphoto Agency Afghan President Hamid Karzai said in a speech Sunday recent Taliban attacks were 'in service to America.' 
 
 Related Coverage Large Explosion Hits Kabul as Hagel Visits 
 
 American defense officials now have to assess how much damage Mr. Karzai's allegations will have on their plans, already threatened by discord over whether to grant immunity from prosecution to U.S. troops and by the Afghan leader's refusal to negotiate with the North Atlantic Treaty Organization. 
 
 The war against the Taliban has claimed the lives of 2,179 American service members since 2001, says the casualty tracking website icasualties.org. While the U.S. has held talks with the Taliban in the past, contacts were stalled by the Taliban's refusal to negotiate directly with Kabul. 
 
 Mr. Karzai's speech on Sunday sparked some frank exchanges during Mr. Karzai's dinner at the presidential palace with Mr. Hagel, Gen. Dunford and other officials from both nations, U.S. officials said. Mr. Hagel "struck the right balance between expressing support for Afghanistan and strongly pushing back on wildly inaccurate claims," one U.S. official said. 
 
 After the dinner, Mr. Hagel offered a muted public response to Mr. Karzai's comments that came in contrast to the forceful defense from Gen. Dunford. "I told the president it was not true that the United States was unilaterally working with the Taliban," Mr. Hagel told reporters. 
 
 The defense secretary suggested that the Afghan president might have been baiting America to cultivate support from anti-Western forces in the politically fractured country. Mr. Karzai's term expires next year, and the field of potential successors is wide open, ranging from his brother and other allies to bitter political foes. "I was once a politician, so I can understand the kind of pressures that especially leaders of countries are always under, so I would hope that, again, we can move forward—and I have confidence that we will," Mr. Hagel said. 
 
 The Afghan president's spokesman, Aimal Faizi, said the Afghan leader used the occasion to complain about civilian casualties of U.S. operations and the detentions of Afghan citizens. 
 
 In particular, Mr. Faizi said, Mr. Karzai raised the issue of an engineering student who, he said, had been seized illegally at Kandahar University by an Afghan militia working for the Central Intelligence Agency. Mr. Karzai mentioned in his speech that he was up until as late as midnight on Saturday to win the student's release; on Sunday, he issued a decree banning foreign forces from entering universities and detaining Afghan students. 
 
 The CIA declined to comment on the matter. 
 
 "Such incidents, if they continue, are a clear breach of Afghan national sovereignty, and will create anger among the people," Mr. Faizi said. "Any kind of bilateral relations should be based on respect of sovereignty of the two nations." 
 
 Mr. Karzai gained power following the U.S. ouster of the Taliban regime in 2001, and initially enjoyed close ties with the U.S., holding weekly videoconference calls with President George W. Bush. 
 
 These relations deteriorated during the 2009 Afghan presidential elections, after which Mr. Karzai accused some Obama administration officials of scheming to oust him. 
 
 In previous statements, Mr. Karzai also alleged that the U.S. was secretly flying insurgents into northern Afghanistan in helicopters, as part of a plan to destabilize the country, and once even threatened to join the Taliban himself. 
 
 Mr. Karzai and Mr. Hagel have a strained personal history. In 2008, Mr. Hagel joined fellow Senators Joe Biden and John Kerry for a turbulent dinner in which they pressed the Afghan president to seriously tackle corruption in his government. When Mr. Karzai dismissed the concerns as unfounded, Mr. Biden stormed out of the meeting, throwing down his napkin. 
 
 Mr. Hagel's restrained comments on the Afghan president Sunday suggested that U.S. leaders recognize that they need Mr. Karzai's cooperation to complete the withdrawal of U.S. troops and equipment. Military analysts said Mr. Karzai might be trying to challenge Mr. Hagel, who has orders from President Barack Obama to quickly end the war. 
 
 "President Karzai has a history of testing new [coalition] commanders to see what the response is to his demands," said Kimberly Kagan, founder of the Institute for the Study of War who has consulted with the U.S.-led forces in Afghanistan. 
 
 U.S. officials have envisaged that NATO allies would make up a large part of the residual force after 2014. Mr. Karzai, however, on Sunday reiterated his opposition to any deal with NATO as a whole, saying nations wanting to keep troops here would need to negotiate directly with Kabul. 
 
 "If you want to stay beyond 2014, all of you separately need to sign agreements with the Afghan people," Mr. Karzai said Sunday. "Limited numbers, in a location we chose and under our conditions and framework, with respect for our laws, our sovereignty, our traditions and culture." 
 
 Few, if any, Western allies would consider contributing troops outside the NATO framework, diplomats say. "They want us out, that is for sure," a Western official said. "They feel that we are part of the problem." 
 
 Despite these tensions, Gen. Dunford defended U.S.-Afghan relations, especially between military leaders of the two countries, as dynamic partnerships that can be the "shock absorbers" through turbulent times. "We don't have a broken relationship," he said. "We don't have a lack of trust. We have a relationship that can actually absorb this tension as we work through difficult issues." 
 
 But Mr. Karzai's Sunday speech was only one such shock to the relationship. It followed the U.S.'s abrupt cancellation of its planned handover of the main U.S. detention facility at Bagram Air Field, and Mr. Karzai's demand that U.S. Special Operations forces leave the strategic province of Wardak near Kabul. 
 
 Following Mr. Karzai's speech, Mr. Hagel also canceled a planned joint news conference with the Afghan leader at the presidential palace. U.S. officials said this was because of security concerns that rippled across Kabul in the wake of Saturday's bombings. 
 
 U.S. bases in the capital were on heightened alert. Mr. Hagel previously canceled scheduled visits to the Ministry of Defense—site of Saturday's Kabul bombing—and the Interior Ministry. Instead, he met with the two ministers at alternative locations in the city. 
 
 —Habib Khan Totakhil, Julian E. Barnes and Siobhan Gorman contributed to this article. 
 
 Write to Yaroslav Trofimov at yaroslav.trofimov@wsj.com
– Chuck Hagel finally did meet privately with Afghan President Hamid Karzai yesterday before returning to Washington today, and despite the security concerns that initially canceled the meeting, Hagel told the press he and Karzai discussed key issues, the AP reports. "I think he understands where we are and where we've been, and hopefully where we're going together," Hagel said, without giving any details. Both Hagel and Gen. Joseph Dunford, the top US commander in Afghanistan, rejected comments Karzai made prior to the meeting in which he accused the US and the Taliban of working together to prove the situation in Afghanistan will deteriorate after most US troops withdraw next year. Dunford called the comments "categorically false" and said Karzai has never expressed such charges to him personally, but added that tensions are inevitable as withdrawal looms. He added that there is no "broken relationship" or "lack of trust" between the US and Afghanistan. The security threat, as well as the attacks that rocked Afghanistan during Hagel's visit, were just the latest in a series of recent flare-ups in tension between the US and Afghanistan. Both Hagel and Dunford said Karzai's incendiary comments were likely more political than anything else, citing the pressure Karzai is under. But, US officials tell the Wall Street Journal, Hagel "strongly push[ed] back on [the] wildly inaccurate claims" during his meeting with Karzai.