A suicide bomber hit a convoy of international troops in Afghanistan on Wednesday, the U.S.-led military coalition in the country said in a statement. The U.S. military later confirmed that two American servicemembers were killed in the attack.

The attacker struck the convoy on the edge of the southern city of Kandahar.

A statement released by Operation Resolute Force confirmed that a NATO convoy had been hit and that there were casualties, and said they were "working to gather additional information as soon as possible."

U.S. troops assess the damage to an armoured NATO vehicle after a Taliban suicide attack in Kandahar province, Afghanistan, August 2, 2017. REUTERS

Qari Yousuf Ahmadi, a Taliban spokesman in southern Afghanistan, claimed responsibility for the attack in a phone call to CBS News. He said a suicide bomber driving a van attacked U.S. forces and claimed many had been killed and wounded, but the Taliban often greatly exaggerates causalities from its attacks.

Get Breaking News Delivered to Your Inbox

The combined U.S. and NATO troop contingent currently in Afghanistan is about 13,500. The Trump administration is deciding whether to send about 4,000 or more U.S. soldiers to Afghanistan in an attempt to stem Taliban gains.

The attack came as Afghan authorities in western Herat province tightened security ahead of a mass funeral for the victims there of an attack the previous evening that killed 29.

A suicide attacker opened fire inside a mosque packed with worshippers at evening prayers, before detonating his explosives. A second explosion came 10 minutes later.

No one has claimed responsibility for that attack either, but it came a day after the Islamic State group warned it would strike Shiites. The Sunni militant group considers Shiite Muslims as apostates.