Standing alone and not wearing a mask, Trump spoke from the White House balcony at an event called "a peaceful protest for law & order," attended by a few hundred people standing on the lawn below.
His appearance is seen as a first step toward resuming full campaigning next week.
Speaking without hesitation, Trump appeared to be back to his usual rallying form, boasting about his record and hurling unsubstantiated allegations against his opponents as a packed crowd of supporters chanted, "We love you."
It was the first public event Trump has held since he was released from the hospital on Monday, when some observers watching his return to the White House said he appeared at times to be short of breath.
The White House has released videos and Trump has called into television shows since then, but this was the public's first chance to see the president live.
The White House has not released the results of Trump's latest COVID-19 test, and has declined to say when he last tested negative.
A White House spokeswoman said on Friday that Trump would be tested for COVID-19 and would not go out in public if it was determined he could still spread the virus.
DONALD TRUMP: Thank you. Well, thank you very much, and keep that enthusiasm going. Get out and vote. We got a vote. We got to vote these people into oblivion.
First of all, I'm feeling great. I don't know about you. How is everyone feeling? Good? And I'm honored to welcome, we call this a peaceful protest. To the White House, in support of the incredible men and women of law enforcement, and all of the people that worked so well with us. And I have to tell you, our Black community, our Hispanic community. Thank you very much.
But before going any further, I want to thank all of you for your prayers. I know you've been praying. And I was in that hospital, I was watching down over so many people. And I went out to say hello to those people. And I took a little heat for it. But I'd do it again, let me tell you, I'd do it again.
We're starting very, very big with our rallies, and with our everything. Because we can not allow our country to become a socialist nation. We cannot let that happen. And that's what would happen. Or worse, by the way, or worse. I want you to know are nation's going to defeat this terrible China virus, as we call it. And we're producing powerful therapies and drugs, and we're healing the sick. And we're going to recover, and the vaccine is coming out very, very quickly, in record time, as you know. It's coming out very, very soon. We have great, great companies doing it. And they'll be distributing it. And we will, through our military, very, very rapidly.
This is the single most important election in the history of our country. Get out and vote, and I love you. Thank you. Thank you very much. Thank you. Thank you very much.