WASHINGTON — Venezuela’s opposition leader, Juan Guaidó, has long hoped to land a meeting with President Trump that would demonstrate the United States’ support for his claim to being the country’s rightful president.

He struck out when he and Mr. Trump were both in Davos, Switzerland, last month, and then again when they were both in South Florida last weekend. The near misses fueled speculation that Mr. Trump had lost interest in supporting the chief rival of Venezuela’s leftist president, Nicolás Maduro, with whom Mr. Guaidó had been locked in a yearslong political stalemate.

But Mr. Guaidó’s visit to Washington this week more than made up for those disappointments when Mr. Trump gave him two moments in the spotlight that could lift him at home.

First Mr. Trump hosted Mr. Guaidó at his State of the Union address on Tuesday night and in his speech delivered one of his most forceful endorsements of the opposition, describing Mr. Guaidó as “the true and legitimate president of Venezuela” and promising that Mr. Maduro’s “grip on tyranny will be smashed and broken.”