Media playback is unsupported on your device Media caption President Trump: "We remember the moment when America fought back"

US President Donald Trump and First Lady Melania Trump have visited a memorial in Pennsylvania to mark the 9/11 attacks 17 years ago.

Mr Trump delivered a speech commemorating the airplane passengers who are thought to have charged the cockpit to stop the attackers.

Ceremonies are also being held at New York City's 9/11 Memorial plaza on the World Trade Center site.

It was deadliest foreign attack ever on US soil, killing 2,996 people.

"America's future is not written by our enemies. America's future is written by our heroes," Mr Trump said in Shanksville on Tuesday.

"As long as this monument stands, as long as this memorial endures, brave patriots will rise up in America's hours of need and they, too, will fight back."

The president spoke at the newly inaugurated Tower of Voices memorial, a 93ft (28m) tall structure with 40 wind chimes.

On 11 September 2001, hijackers flew planes into the World Trade Center in New York City, and the Pentagon in Arlington, Virginia.

Image copyright Reuters

Another plane, United Airlines Flight 93, crashed in a field in Shanksville, Pennsylvania.

It is believed hijackers were planning to aim that aircraft at the US Congress or White House in Washington DC before it went down, killing all 40 people aboard.

Cockpit voice recordings of the hijackers and mobile phone calls from those aboard to loved ones indicate passengers tried to fight their way into the cockpit to regain control before the plotters nosedived the plane.

Media playback is unsupported on your device Media caption A 9/11 survivor speaks to students who were born after the World Trade Center attack

Mr Trump praised the passengers' "incredible valour" and said their revolt was "the moment America fought back".

"A band of brave patriots turned the tide on our nation's enemies and joined the immortal rank of American heroes," he said.

Media playback is unsupported on your device Media caption Deena Burnett recalls last moment she spoke to her husband Tom on 9/11

He is the third sitting president to attend the crash site, 70 miles (110km) south-east of Pittsburgh.

Image copyright Getty Images Image caption The Tower of Voices memorial has been erected at the Flight 93 crash site

Senator John Cornyn, a Texas Republican, was among those who noted this is the first year that Americans born after the attacks will be old enough to enlist in the US military.

During remarks at the Pentagon, Vice-President Mike Pence told audience members they "must learn the lessons of 9/11 and remain ever vigilant".

Image copyright Reuters Image caption A soldier honours a victim at the memorial in New York City

The ceremony in New York was attended by New York Governor Andrew Cuomo, US ambassador to the United Nations Nikki Haley and Mayor Bill de Blasio, as well as his predecessors Michael Bloomberg and Rudy Giuliani.

Relatives of victims read out the names of the dead, and moments of silence were observed at 08:46 and 09:03 to mark the times when passenger jets struck the two skyscrapers.

Image copyright Getty Images Image caption A guest wipes a tear at the New York memorial

In the years since the attacks, cancer cases in lower Manhattan - especially among first responders who dug through the toxic rubble - have increased.

The 9/11 Victims' Compensation Fund has paid out $4bn (£3.1bn ) to fund medical expenses for survivors of the terror attacks.

Image copyright Reuters

Nearly 10,000 of them have had some form of cancer, according to the World Trade Center Health Program.

Tens of thousands of people inhaled fumes in the days after the attack, and the number of patients coming forward with tumours has increased in recent years, according to the fund.