MAZAR-I-SHARIF/Washington - Suspected Islamic State militants attacked Taliban fighters attending a funeral in northern Afghanistan on Tuesday and killed at least 15 in the latest violence between the rival groups, officials said.

Another five Taliban were wounded in the attack on a house in Sayad district in Sari Pul province, the provincial police chief Abdul Qayum Baqizoi told AFP. A Taliban commander was among the dead, Baqizoi added.

The attackers, who were armed with guns and grenades, fled the area.

The Sari Pul governor's spokesman Zabiullah Amani confirmed the death toll. "Daesh and Taliban have been fighting each other for more than two months in (neighbouring) Jowzjan and Sari Pul, killing hundreds on both sides," Amani said, using the Arabic acronym for the Islamic State group.

The Taliban have not commented on the attack. IS did not immediately claim responsibility.

IS first emerged in Afghanistan in 2014, overrunning large parts of the eastern provinces of Nangarhar and Kunar near the Pakistan border, where it engaged in a turf war with the Taliban.

The group has since expanded north and has been battling the Taliban as well as Afghan and US forces.

While the Taliban are Afghanistan's largest militant group, IS has a small but potent presence in the country and has repeatedly demonstrated an ability to carry out devastating attacks in urban areas, including Kabul.

62 MILITANTS, 9 POLICEMEN DEAD IN CLASHES

Up to 62 militants have been killed during airstrikes by Afghan air force in south Afghanistan's Kandahar province over the past 24 hours, said Yahya Alavi, an army spokesman in the southern region on Tuesday.

"The army aircraft targeted the hideouts of Taliban militants in Maroof district of southern Kandahar province several times over the past 24 hours, as a result 62 militants including a local commander of the insurgent group have been killed and three others injured," Yahya Alavi told Xinhua.

Similarly, in a separate incident, nine policemen were killed and seven others injured during a clash with the Taliban militants in the neighboring Arghistan district of Kandahar province, on Monday night, Dawood Ahmady, spokesman for provincial governor told Xinhua. Taliban militants have yet to make comment.

Meanwhile, NATO's Afghanistan mission denied Monday reports that its commander has said America is ready to join direct talks with the Taliban.

US General John Nicholson spoke with Afghan officials in Kandahar, where he reportedly said the US was "ready" to talk to the Taliban - a shift from the long-held position of Kabul needing to lead any peace process.

In a statement, Nicholson said his comments had been mischaracterised and that he was merely reaffirming remarks by US Secretary of State Mike Pompeo, who in June said the US is prepared to "support, facilitate and participate" in eventual peace talks.

"The United States is not a substitute for the Afghan people or the Afghan government," Nicholson said in the statement released by NATO's Resolute Support mission.

Resolute Support spokesman Lieutenant Colonel Martin O'Donnell added that the US is exploring "all avenues" to advance a peace process. "But this remains an Afghan-led process," O'Donnell said.

READ MORE: Going not-so green

The New York Times on Sunday reported that the administration of President Donald Trump had told its top diplomats to seek direct talks with the Taliban.

The insurgent group has long maintained it wants to talk only with the US, while Washington has insisted the Afghan government be involved.

The Taliban have been rampant in recent years. Trump in 2017 reluctantly agreed to commit thousands more US troops to the 17-year-old fight. But Afghan security forces have been struggling to beat back the insurgents amid desertions, killings and corruption.

Afghan President Ashraf Ghani and other Afghan leaders have repeatedly offered peace talks with the Taliban.

Around 16,000 troops from the United States, NATO and other partner countries are in Afghanistan, training the Afghan forces within the framework of a NATO-led RS mission.