KENNEDY SPACE CENTER, Fla. — For President Trump, the launch of the sleek SpaceX rocket with two NASA astronauts on Saturday not only propelled America back into the heavens but, he hoped, gave a booster shot to his own beleaguered presidency after months of misery afflicting the country.
After watching from a rooftop barely a mile from the fabled launchpad, 39A, on a hot but clear afternoon, Mr. Trump hailed the successful launch of the privately built Falcon 9 rocket as a sign of American resilience in the face of disease, death and economic hardship, evoking the spirit of the Apollo days to portray a country on the rebound.
And he left little doubt that he saw it as a personal and political triumph as well, staging a campaign-style rally afterward in a NASA hangar in front of a model of the Crew Dragon capsule that had just been propelled into space. Both on the rooftop during the launch and in the hangar afterward, loudspeakers blared songs from Mr. Trump’s campaign playlist and the president rewrote history to leave out the work of two previous administrations while he claimed singular credit.
But the split-screen nature of this moment in his presidency was underscored when Mr. Trump devoted the first nine minutes of his speech to the killing of George Floyd in Minneapolis and the subsequent protests and riots unfolding in cities across the country.
Likewise, he acknowledged the coronavirus pandemic that has claimed more than 100,000 lives and put more than 40 million out of work.
“We are reminded that America is always in the process of transcending great challenges,” he told space program workers in the hangar. “The same spirit of American determination that sends our people into space will conquer this disease on earth. It should have never happened. Nothing, not even gravity itself, can hold Americans down or keep America back.”
Speaking separately with reporters, Mr. Trump said he was motivated to come in person in part because of the pandemic. “That’s one of the reasons I wanted to be here today,” he said. “I thought it was so important to be here today. I think any one of you would say that was an inspiration to see that today.”
The launch was the first time NASA astronauts have been sent into orbit from American soil since the space shuttle fleet was retired in 2011, ending nearly a decade of uncomfortable reliance on Russia for transport to the space station and inaugurating a new era in which private firms like SpaceX, founded by the president’s friend Elon Musk, take over the business of spaceflight.
Mr. Trump was so intent on associating himself with the breakthrough moment that he came from Washington to view the launch in person not once but twice, returning on Saturday even after the first attempt was scrubbed on Wednesday because of bad weather. For the most part, presidents have avoided attending space launches partly because delays are normal. There were also fears of being seen as pressuring flight controllers to move forward under imperfect conditions, and none of them wanted to be on hand if something went wrong.
Until now, sitting presidents showed up for launches just twice. In 1969, President Richard M. Nixon attended the liftoff of Apollo 12, which was then struck by lightning twice during its ascent but still managed to recover and ultimately make it to the moon. In 1998, President Bill Clinton came to witness John Glenn return to space on the shuttle 37 years after his original orbital flight. Lyndon B. Johnson came for the launch of Apollo 11 after leaving office.
There seems to be little doubt that the moment will make it into a Trump campaign ad soon enough. The Village People’s “Macho Man,” a regular staple of the president’s campaign rallies, played on the rooftop before the launch and then, with a short break for the last seconds of the 3-2-1 countdown, the speakers played Elton John’s “Rocket Man,” another Trump favorite as the real-life rocket climbed into the skies.
Mr. Trump was later ushered onto stage with Lee Greenwood’s “God Bless the U.S.A.” and brought off by “You Can’t Always Get What You Want” by the Rolling Stones, just as he has been at the campaign rallies he has had to suspend because of the virus.
Joining the president on top of Operational Support Building II was a partisan cast of guests, including Vice President Mike Pence and his wife, Karen Pence; Representative Kevin McCarthy of California, the House Republican leader; Gov. Ron DeSantis of Florida; and a variety of cabinet secretaries, senior administration officials. In his remarks, he thanked Mr. DeSantis, 16 Republican lawmakers and various Republican state officials and no Democrats.
Mr. Trump happily took credit for the day’s event. “You know, four years ago this place was essentially shut down,” he told reporters. “The space program was over. The shuttle program was dead.” He added: “And now we’re the leader in the world again. And this is just the beginning. They’re going to Mars. They’re going to the Moon but they’re going to the Moon in order to go to Mars.”
In the speech, Mr. Trump said, “When I first came into office three and a half years ago, NASA had lost its way and the excitement, energy and ambition as almost everybody in this room knows was gone,” he said. “The last administration presided over the closing of the space shuttle.”
Mr. Trump was indeed the one to decide to push to return to the moon and then Mars and he revived the National Space Council, putting Mr. Pence in charge of it. But the commercial launch on Saturday had its origins under two previous presidents.
President George W. Bush, not President Barack Obama, was the one who ordered the aging shuttles to be phased out, but initiated a commercial cargo program, paying SpaceX and other companies to develop cheaper capsules to send materials to the space station.
Mr. Obama then decided to send crews via commercial spacecraft in 2011, an initiative that encountered fierce opposition from Congress, which at first did not provide as much money as NASA sought. Mr. Obama was never as personally enthusiastic about the space program as Mr. Trump and never invested as much political capital in it, but his NASA administrator, Charles F. Bolden Jr., stuck with the program, steadily advancing it.
Mr. Trump made no mention of that on Saturday, but his own NASA administrator, Jim Bridenstine, has credited his predecessor in recent days. Mr. Bolden “did just yeoman’s work in order to get this program off the ground to get it going,” said Mr. Bridenstine, a former Republican congressman who carried the project across the finish line after being confirmed by the Senate in 2018. “And here we are, all these years later, having this success.”
Former Vice President Joseph R. Biden Jr., the putative Democratic nominee challenging Mr. Trump in the fall, was not willing to cede the ground entirely. “This mission represents the culmination of work begun years ago, and which President Obama and I fought hard to ensure would become reality,” he said in a statement.
But emailed statements were no match for being there. It was Mr. Trump, not Mr. Obama or Mr. Biden, who talked with the astronauts, Robert L. Behnken and Douglas O. Hurley, before they took off. He said he told them, “God bless you. There’s nothing else you can say. God bless you. They have a lot of courage.”
Mr. Trump looked happier than he had in a while, exulting over the day as he noted the roar of the takeoff and the tremble felt on the rooftop a few moments later. It was, he said, “a beautiful sight.” And one he would like Americans to see again and again in the days and months to come.