KABUL — US 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. Meanwhile, a police officer opened fire on US and Afghan forces on Monday, killing two US troops and two other Afghan policemen. 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 US and the Taliban are working in concert to show that violence in the country will worsen if most coalition troops leave. The top US 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 US 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 US 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 US prison to Afghan authority as well as Karzai's order to expel US 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 US invasion in late 2001, adding that such extended relationships can often be beneficial, especially when dealing with complicated issues. The US 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. US 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 US 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. Meanwhile, A police officer opened fire on US and Afghan forces inside a police headquarters in eastern Afghanistan on Monday, sparking a firefight that killed two US troops and two other Afghan policemen. The attacker was also killed in the shootout, officials said. In Monday's attack, an Afghan police officer stood up in the back of a police pickup truck, grabbed hold of a machine gun and started firing at the US special operations forces and Afghan police in the police compound in Jalrez district, said the province's Deputy Police Chief Abdul Razaq Koraishi. The assailant killed two Afghan policemen and wounded four, including the district police chief, before he was gunned down, Koraishi said. — Agencies