President Donald Trump warned Wednesday that what he described as an unprecedented US military assault against the Taliban in Afghanistan is to continue, just five days after he scrapped peace talks.

Speaking at a ceremony marking the 18th anniversary of the 9/11 attacks, Trump said that over "the last four days" US forces have "hit our enemy harder than they have ever been hit before and that will continue."

Trump said the assault was ordered after he cancelled secret peace talks with the Taliban over the weekend in retaliation for a bomb attack that killed one US soldier last week.

President Trump and First Lady Melania Trump welcomed victims' families and survivors to the White House where they marked the anniversary with a moment of silence.

Trump then delivered his speech at the Pentagon, one of the targets of the 9/11 attacks.

Earlier on Wednesday, New York honoured the almost 3,000 people killed on September 11, 2001 in a solemn ceremony at Ground Zero where hijacked Al-Qaeda planes brought down the Twin Towers.

Relatives of victims, police officers, firefighters and city leaders gathered at the National September 11 Memorial to mark the 18th anniversary of the deadliest single attack on US soil.

They held poignant moments of silence at 8:46 am (2.46 pm in Malta) and 9:03 am, the precise times that the passenger jets struck the North and South Towers.

New York Governor Andrew Cuomo, Mayor Bill de Blasio, and his predecessors Michael Bloomberg and Rudy Giuliani were among those who attended.

In what has become an annual tradition, relatives began reading out the long list of those who were killed, saying a few words about those who died, in a ceremony that takes almost four hours.

"We love you, we miss you and you will always be America's heroes," said one woman after reading out the names of her brother and cousin.

Relatives hugged and consoled each other and left roses at the memorial. Some held up placards with images of their loved ones who were killed.

Bagpipes played as police officers walked into the ceremony carrying the US flag before the US national anthem was played.

Al-Qaeda hijacked a total of four planes. The third hit the Pentagon and the fourth, Flight 93, crashed in a field in Shanksville, Pennsylvania.

In addition to those killed on September 11, thousands of first responders, construction workers and residents have since developed illness, many of them terminal, as a result of inhaling the toxic fumes.