WASHINGTON — In a made-for-television Independence Day production starring America’s military weaponry, President Trump on Thursday used the Lincoln Memorial as the backdrop for a tribute to the country’s armed forces and a call for unity that has been largely absent during his divisive presidency.

Flanked by Bradley armored vehicles and M1A2 tanks in front of the statue of Abraham Lincoln, Mr. Trump paid homage to the five branches of the military as a chorus sang each service hymn and he cued the arrival of fighter jets, helicopters and other military aircraft as they roared overhead.

Speaking to a rain-soaked audience filled with troops decked out in “Make America Great Again” and “Trump 2020” paraphernalia, the president finally presided over the grand military display that he has wanted since witnessing the Bastille Day parade in Paris two years ago.

In a 45-minute speech delivered behind rain-streaked bulletproof glass, the president singled out a long list of Americans for their contributions to science, medicine, politics and the arts, and spun a history that praised everything from the civil rights movement to space exploration and praised everyone from the suffragists to Harriet Tubman to Chuck Yeager. But he spent most of his time recounting the progression of the armed forces, ending his remarks as the “Battle Hymn of the Republic” blared through huge speakers and the Blue Angels soared overhead.