President Trump vowed Wednesday to strike back with power the United States “has never used before” if the country faces another attack similar to those that occurred Sept. 11, 2001, pledging that any would-be perpetrators “will never have seen anything like what will happen to them.”

The president was speaking at the Pentagon during a memorial on the 18th anniversary of the attacks, in which nearly 3,000 people were killed in New York, Shanksville, Pa., and Arlington, Va.

“The last four days, we have hit our enemy harder than they have ever been hit before, and that will continue,” Trump said, apparently referring to the Afghanistan war and drawing applause from the crowd. “And if for any reason they come back to our country, we will go wherever they are and use power the likes of which the United States has never used before — and I’m not even talking about nuclear power. They will never have seen anything like what will happen to them.”

The appearance was Trump’s third commemorating the Sept. 11 attacks since becoming president. Last year, he visited Shanksville, where he paid tribute to the passengers of Flight 93, who died disrupting the plan of terrorists to crash one of their hijacked planes into the U.S. Capitol.

At the Pentagon on Wednesday, Trump told attendees that “for every American who lived through that day, the September 11 attack is seared into our soul.”

He noted that he had called off negotiations over the withdrawal of U.S. troops from Afghanistan after the Taliban took responsibility for an attack last week that killed a U.S. soldier. Trump had invited Afghan and Taliban leaders to Camp David but abruptly announced via Twitter that he had canceled the previously-undisclosed summit.

“We had peace talks scheduled a few days ago,” Trump said. “I called them off when I learned that they had killed a great American soldier from Puerto Rico and 11 other innocent people. They thought they would use this attack to show strength, but actually, what they showed is unrelenting weakness.”

Trump faced a backlash from lawmakers on both sides of the aisle — as well as from some members of his administration — for extending the invitation to Taliban leaders days before the Sept. 11 anniversary.

Shortly after Trump spoke Wednesday morning, Vice President Pence delivered remarks commemorating the Sept. 11 anniversary in Shanksville.

“Today, all across this country, Americans will pause to reflect, remember and never forget the events of this day 18 years ago,” Pence said. “In New York City, at the Pentagon, and here in Shanksville, Pennsylvania — here, where a common field one day became a field of honor forever.”

In his remarks at the Pentagon, the president went into greater detail than he has previously in discussing what he was doing when he heard the news of the attacks 18 years ago. He said he was at home watching television.

“I vividly remember when I first heard the news, I was sitting at home watching a major business television show early that morning,” Trump said. “Jack Welch, the legendary head of General Electric, was about to be interviewed when all of a sudden they cut away.”

He also claimed he had watched from his apartment, which is about four miles from the World Trade Center, as the second of the planes hit the site on the morning of the attacks.

“I was looking out a window from a building in midtown Manhattan directly at the World Trade Center when I saw a second plane at a tremendous speed go into the second tower,” he said. “It was then that I realized the world was going to change.”

Trump has made a variety of claims about what he was doing on the morning and in the aftermath of the attacks. He previously said he watched through a telescope as “many people” jumped from the twin towers. During the 2016 campaign, Trump also falsely claimed that “thousands” of New Jersey Muslims celebrated the attacks.

On Wednesday, the president repeated his claim that he went to Ground Zero days after the attacks, in an effort to help those at the site.

“Soon after I went down to Ground Zero with men who worked for me to try to help in any little way that we could,” he said. “We were not alone. So many others were scattered around trying to do the same. They were all trying to help.”

Trump did go to Ground Zero after the attacks. But after he claimed in 2016 that he “helped a little bit” with clearing rubble at the site, his campaign did not respond to a request for details.

Before participating in remembrance activities Wednesday morning, Trump took to Twitter to attack Federal Reserve officials as “boneheads” for not moving more quickly to lower interest rates and to complain about a Washington Post-ABC News poll showing him trailing major Democratic rivals in hypothetical general-election matchups.

In one tweet, Trump asserted that he would be leading his Democratic rivals by 20 points if not for “the never ending Fake News about me.”

Two minutes later, Trump tweeted: “Leaving the White House soon to speak at the Pentagon. My great honor!”

He participated in a moment of silence on the White House lawn at 8:46 a.m. — the time of the first plane hitting the twin towers — before heading to the Pentagon.

JM Rieger contributed to this report.