Afghan National Army (ANA) soldiers walk in Helmand on Dec. 21, 2015. Clashes intensified as the Taliban pressed an offensive to capture a key district in Helmand, a day after an official warned that the entire southern province was on the brink of collapse. Noor Mohammad/AFP/Getty Images

Six American troops were killed in Afghanistan on Monday when a suicide bomber on a motorbike struck their patrol near Bagram air base, officials said, the deadliest attack on U.S. forces this year.

U.S. Defense Secretary Ash Carter, who stopped briefly at Bagram on Friday, said the deaths were a "painful reminder" of the dangers still faced by U.S. troops in Afghanistan long after fighting has largely shifted to local forces.

Just last week, the Pentagon warned of deteriorating security in Afghanistan and assessed the performance of Afghan security forces as "uneven and mixed."

The Taliban, which claimed responsibility for the strike, remains resilient 14 years after the start of U.S. military engagement in Afghanistan. It has ramped up its attacks this year, inflicting heavier casualties on Afghan security forces.

"Our deepest sympathies go out to the families of these brave Americans who died in service to this vital mission," Carter said. Two servicemembers were wounded along with a contractor.

The Parwan province police chief said three Afghan police had also been wounded in the bombing, which was carried out just days after other suicide attacks on Kandahar air base in southern Afghanistan and on a Spanish embassy guesthouse in the Afghan capital, Kabul.

Bagram, around 40 km (25 miles) north of Kabul, is one of the main bases for the 9,800 U.S. troops left in Afghanistan after international troops ended combat operations last year.

District Governor Abdul Shukur Qudusi said the bomber detonated his explosives near a joint U.S.-Afghan patrol.

The attack underlined the Taliban's ability to hit high-profile targets linked to the U.S.-backed government, which wants to reopen the peace process aimed at ending the 14-year-long insurgency.

On Monday, Taliban forces in Helmand closed in on the district of Sangin as they tightened their grip on the volatile southern province.

In a report to the U.S. Congress released last week, the Pentagon said casualties among Afghan national defense and security forces, or ANDSF, rose 27 percent from Jan. 1 to Nov. 15, compared with the same period last year.

More than 2,300 U.S. troops have died in the Afghan war since the 2001 invasion, but the pace of U.S. deaths has fallen off sharply since the end of formal U.S. combat and a drawdown of American forces.

Pentagon data showed there have been 10 so-called "hostile" deaths of U.S. servicemembers in Afghanistan this year. There have been 10 non-hostile deaths, largely from aircraft crashes.

(Reporting by Mirwais Harooni in Kabul and Phil Stewart in Washington; writing by James Mackenzie; editing by Nick Macfie and Grant McCool)