A U.S. service member was killed on patrol in western Afghanistan on Thursday, while insurgents in the east attacked police posts and a government building, sparking a battle that killed six policemen and 21 insurgents, officials said.

The American, who was not identified, was killed during "a combat reconnaissance patrol" in Farah province, the U.S. military said, without providing other details.

As of Tuesday, at least 646 members of the U.S. military had died in Afghanistan, Pakistan and Uzbekistan as a result of the U.S.-led invasion of Afghanistan in late 2001, according to the Defense Department. Of those, the military reports 479 were killed by hostile action.

In neighboring Helmand province, a British soldier died Tuesday night in an explosion, the British Defense Ministry said. He was the seventh British soldier killed in Afghanistan in a week, the ministry said.

The attacks against government facilities started Tuesday in the Barghe Matal district of Nuristan province and continued into the following day, spokesman Zemerai Bashary said.

Hundreds of insurgents attacked the police posts and a government center in Barghe Matal, Bashary said.

"We are working on a plan to send reinforcements," Bashary said.

Insurgents historically used Nuristan's mountainous and heavily wooded terrain as a base for operations. The remote province borders Pakistan's tribal area, where insurgents are also active.

The Obama administration has declared that eliminating militant havens in Pakistan and Afghanistan is vital to its goals of defeating Al Qaeda and winning the war in Afghanistan.