NATO officials in Afghanistan say two U.S. soldiers were killed and seven others wounded in an apparent insider attack in the eastern part of the country.
Authorities say a shooter dressed in either an Afghan military or police uniform opened fire in Wardak province, killing the Americans as well as several Afghan soldiers.
Also Monday, NATO officials said five members of the NATO-led coalition force died when their helicopter crashed in southern Afghanistan. The cause of the crash is being investigated. NATO did not release the nationalities of the soldiers.
Outside Kabul, U.S. troops shot and killed two Afghan civilians after their vehicle approached a U.S. convoy. A U.S. military official said the Afghans failed to heed instructions to stop as it came close to the convoy.
Monday's violence came as U.S. Defense Secretary Chuck Hagel left Afghanistan following a first visit that was marred by a contentious speech by Afghan President Hamid Karzai and a series of security threats that forced the cancellation of a scheduled news conference with the president Sunday.
Authorities did not elaborate on the security issues, but on Saturday two suicide bombings -- one in Kabul and the other in Khost -- killed 19 people. The bombing in Kabul targeted the Afghan Defense Ministry as Hagel was visiting the capital.
In a speech early Sunday, President Karzai accused the Taliban of being "at the service of America" by using attacks like the ones on Saturday to frighten Afghans into wanting foreign forces to remain in Afghanistan beyond the 2014 deadline.
In comments to reporters travelling with him, Hagel said he spoke "clearly and directly" to Mr. Karzai, saying it was not true that the United States was working unilaterally with the Taliban. He said that any prospect for peace or political settlements "has to be led by the Afghans."
The Karzai government also alleged that U.S.-led forces working alongside Afghans were abusing and arresting university students.
Hagel's trip to Afghanistan took place in the middle of a struggle between Afghanistan and the United States over control of detention facilities and the pace for foreign troop withdrawal. A ceremony to transfer U.S. control of a main detention facility to Afghanistan Saturday also was cancelled as a deal struck between the two governments broke down.
Last month, Hagel's predecessor, Leon Panetta, said that NATO allies were considering leaving between 8,000 and 12,000 international troops in Afghanistan after 2014. Currently, there are about 100,000 NATO troops in Afghanistan.