Donald Trump has told visiting members of the UN Security Council the US will no longer talk with the Taliban following a recent string of deadly attacks in Afghanistan.

The US president railed against a series of “atrocities” in Afghanistan and said the US would not engage in any future talks with the Taliban as the administration seeks to end a stalemate in America’s longest war.

“Innocent people are being killed left and right. Bombing, in the middle of children, in the middle of families, bombing, killing all over Afghanistan,” Mr Trump said.

“So we don’t want to talk with the Taliban. There may be a time but it’s going to be a long time.”

His comments followed a deadly car bombing attack in Kabul, the Afghan capital, that killed at least 95 people and wounded 158 more.

Security personnel at the site of an attack at the Marshal Fahim academy in Kabul (AP/Rahmat Gul)

Earlier this month, Americans were killed and injured in the Taliban’s 13-hour siege of a hotel in Kabul.

Mr Trump’s remarks at the diplomatic luncheon marked a shift in tone on Afghanistan. The US has said previously that any peace talks with the Taliban need to be part of an Afghan-led process, but the US has never precluded talking to the Taliban.

Secretary of state Rex Tillerson, who sat next to the president at the luncheon, has said previously that after an effective military effort, a political settlement including some Taliban might be possible, echoing language from former president Barack Obama’s administration.

Mr Tillerson had said the US would support peace talks with the Taliban “without preconditions”.

In January, UN ambassador Nikki Haley, who helped organise Monday’s luncheon, said the US policy on Afghanistan was working and the parties were “closer to talks with the Taliban and the peace process than we’ve seen before”.

Several attempts to hold peace talks between the Afghan government and the Taliban have failed.

In 2013, hopes were raised when the Taliban opened an office in Qatar aimed at facilitating talks, but a controversy over the Talban’s move to hoist the flag it used in Afghanistan during its five-year rule ultimately derailed the talks.

Since then, efforts to lure the Taliban into talks have yielded little progress.

Mr Trump has sought to change the course of the long-running conflict, sending thousands more US troops to Afghanistan and moving away from a “time-based” approach to one that more explicitly links US assistance to concrete results from the Afghan government.

The lunch was attended by representatives from the 15-member UN Security Council, including ambassadors to the US from China, France, Russia and Britain.