US President Barack Obama has urged Americans to remain united in the face of terrorist attacks, in a barely-veiled jab at Republican White House nominee Donald Trump 15 years after 9/11.

Key points: Obama says diversity makes US resilient

Obama says diversity makes US resilient Says much has changed over the past 15 years since the 9/11 attacks.

Says much has changed over the past 15 years since the 9/11 attacks. US preparing to mark 15th anniversary of September 11 attacks

"In the face of terrorism, how we respond matters," Mr Obama said in his weekly radio and online address, delivered on the eve of the 15th anniversary of the September 11 terror attacks in the United States.

"We cannot give in to those who would divide us. We cannot react in ways that erode the fabric of our society.

"It's our diversity, our welcoming of all talent, our treating of everybody fairly no matter their race, gender, ethnicity, or faith that's part of what makes our country great. It's what makes us resilient.

"And if we stay true to those values, we'll uphold the legacy of those we've lost, and keep our nation strong and free."

On several occasions Mr Obama has denounced Mr Trump's bombastic rhetoric towards Muslims.

Following the December shooting rampage in San Bernardino, California, for example, Mr Trump called for a temporary ban on the entry to the United States of all Muslims.

Mr Obama was speaking two months before the presidential election in which real estate magnate Mr Trump will face Democrat Hillary Clinton.

Much has changed since 9/11: Obama

It has been 15 years since the 2001 terrorist attacks ( Reuters: Richard Cohen )

The Al-Qaeda hijackings of September 11, 2001 — the first foreign attack on the US mainland in nearly two centuries — ruptured a sense of safety and plunged the West into wars still being fought today.

More than 2,750 people were killed when two passenger jets destroyed the Twin Towers — the symbol of New York's financial wealth and confidence.

Another jet slammed into the Pentagon, and a fourth jet crashed in a field in Pennsylvania after those on board tried to overpower the hijackers.

Evoking "one of the darkest in our nation's history," Mr Obama noted that much had changed over the past 15 years since the attacks.

"We delivered justice to [Al-Qaeda leader] Osama bin Laden. We've strengthened our homeland security. We've prevented attacks. We've saved lives," he said.

But at the same time "the terrorist threat has evolved", he said, referring to attacks in Boston, San Bernardino and Orlando, Florida.

"So in Afghanistan, Iraq, Syria and beyond, we'll stay relentless against terrorists like Al-Qaeda and [the Islamic State group] ISIL," he said.

"We will destroy them. And we'll keep doing everything in our power to protect our homeland."

AFP