Donald Trump has remembered the "band of brave patriots" who were on a September 11, 2001 flight that crashed in Pennsylvania.
The US president praised passengers and crew members who resisted hijackers and sent a message that the nation would "never, ever submit to tyranny".
As the nation marked 17 years since the 9/11 terror attacks, Mr Trump honoured those killed in a field where a fourth airliner crashed after those on board realised what was happening and several passengers tried to storm the cockpit.
"A piece of America's heart is buried on these grounds, but in its place has grown a new resolve to live our lives with the same grace and courage as the heroes of Flight 93," he said.
"This field is now a monument to American defiance.
"This memorial is now a message to the world: America will never, ever submit to tyranny."
Mr Trump listened as the names of the 40 victims were read aloud, followed by the tolling of bells.
He was joined by First Lady Melania Trump, Pennsylvania governor Tom Wolf and former governor Mark Schweiker, who was the state's lieutenant governor on 9/11.
Nearly 3,000 people died when planes were flown into New York's World Trade Centre and the Pentagon in an attack planned by Al-Qaeda leader Osama bin Laden.
Bin Laden was killed in May 2011 during a US military operation ordered by Barack Obama.
Mr Trump, a New York native, made his first visit as president to the Shanksville site and paid tribute to those who died.
He said the site marks the "moment when America fought back", and said the anniversary recalls the day "a band of brave patriots turned the tide on our nation's enemies and joined the immortal ranks of American heroes".
Mr Trump observed the anniversary for the first time as president last year. He and the First Lady led a moment of silence at the White House marking the time that hijackers flew the first of two planes into the World Trade Centre's twin towers.
The president also participated in the Pentagon's September 11 observance last year.
Vice president Mike Pence represented the administration there yesterday.
The president was in his Trump Tower penthouse, four miles from the World Trade Centre, during the attacks.
He has a mixed history with September 11, often using the terrorist strikes to praise the response of New Yorkers to the attack but also making unsubstantiated claims about what he did and saw that day.
He has also accused fellow Republican George W Bush, who was president on September 11, of failing to keep Americans safe.
Mr Trump has said when talking about Muslims that "thousands of people were cheering" in Jersey City, New Jersey, across the Hudson River from lower Manhattan, as the towers collapsed. There is no evidence in news archives of mass celebrations there by Muslims.
He has also said he lost "hundreds of friends" in the attack on New York.
Mr Trump has not provided any names but mentioned knowing a Catholic priest who died while serving as a chaplain to the city's fire department.