President Donald Trump appeared confused about a longstanding military tradition on Wednesday night.

While speaking with Fox News' Sean Hannity at an Air National Guard hangar in Middletown, Pennsylvania, Trump paused as loudspeakers began playing the tune, "Retreat," in the distance.

It's part of a firmly rooted tradition that predates the American Revolutionary War; the US military tune signals the start and end of the official duty day.

"What a nice sound that is," Trump said, as the tune began playing. "Are they playing that for you or for me?"

Photos of Trump at the event:

12 PHOTOS President Trump speaks about tax reform in Harrisburg, Pennsylvania See Gallery President Trump speaks about tax reform in Harrisburg, Pennsylvania US President Donald Trump speaks on tax reform, at Harrisburg International Airport on October 11, 2017 in Middletown, Pennsylvania. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) U.S. President Donald Trump speaks about tax reform in Harrisburg, Pennsylvania, U.S., October 11, 2017. REUTERS/Joshua Roberts U.S. Secretary of the Treasury Steven Mnuchin waits for U.S. President Donald Trump to speak about tax reform in Harrisburg, Pennsylvania, U.S., October 11, 2017. REUTERS/Joshua Roberts U.S. President Donald Trump is obscured by a teleprompter as he speaks about tax reform in Harrisburg, Pennsylvania, U.S., October 11, 2017. REUTERS/Joshua Roberts Director of the National Economic Council Gary Cohn speaks on a mobile phone as U.S. President Donald Trump speaks about tax reform in Harrisburg, Pennsylvania, U.S., October 11, 2017. REUTERS/Joshua Roberts People listen as U.S. President Donald Trump speaks about tax reform in Harrisburg, Pennsylvania, U.S., October 11, 2017. REUTERS/Joshua Roberts U.S. President Donald Trump speaks about tax reform in Harrisburg, Pennsylvania, U.S., October 11, 2017. REUTERS/Joshua Roberts US President Donald Trump steps out of a limousine to board off Air Force One before departing from Harrisburg International Airport on October 11, 2017 in Middletown, Pennsylvania. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) US President Donald Trump speaks on tax reform inside a hangar at the Harrisburg International Airport on October 11, 2017 in Middletown, Pennsylvania. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) US President Donald Trump speaks on tax reform, at Harrisburg International Airport on October 11, 2017 in Middletown, Pennsylvania. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) U.S. President Donald Trump speaks about tax reform in Harrisburg, Pennsylvania, U.S., October 11, 2017. REUTERS/Joshua Roberts US President Donald Trump speaks on tax reform, at Harrisburg International Airport on October 11, 2017 in Middletown, Pennsylvania. / AFP PHOTO / MANDEL NGAN (Photo credit should read MANDEL NGAN/AFP/Getty Images) Up Next See Gallery Discover More Like This HIDE CAPTION SHOW CAPTION of SEE ALL BACK TO SLIDE

"They're playing that in honor of his ratings," Trump quipped, answering his own question to Hannity. "He's beating everybody."

When the American flag is lowered and raised on US military installations, a bugle blares on loudspeakers as service members and civilians pay their respects to the flag.

Uniformed service members located outside of a building are required to stop and salute the flag, while civilians are required to place their hand over their heart. The tradition also requires service members who are driving vehicles on a military base to pull over and render a salute.

Trump's apparent confusion about the military exercise follows weeks of rebukes from the president about NFL players who kneel during the national anthem in protest of racial injustice and police brutality. Trump has frequently called the peaceful demonstration, which is protected by the First Amendment, a sign of disrespect for the flag, US troops, and the national anthem.

NOW WATCH: The 4 longest range missiles in the world

See Also:

SEE ALSO: 'Russia was an excuse': Trump repeats claim that Democrats are still mad about the 2016 election