Juan Guaido, President of Venezuela's National Assembly, reacts during a rally against Venezuelan President Nicolas Maduro's government and to commemorate the 61st anniversary of the end of the dictatorship of Marcos Perez Jimenez in Caracas, Venezuela January 23, 2019.

Venezuelan opposition leader Juan Guaido declared himself interim president on Wednesday, while hundreds of thousands of Venezuelans poured onto the streets to demand an end to the socialist government of President Nicolas Maduro.

In a statement minutes later, U.S. President Donald Trump recognized Guaido as Venezuela's legitimate interim president.

The citizens of Venezuela have suffered for too long at the hands of the illegitimate Maduro regime. Today, I have officially recognized the President of the Venezuelan National Assembly, Juan Guaido, as the Interim President of Venezuela

Demonstrators clogged avenues in eastern Caracas, chanting "Get out, Maduro" and "Guaido, Presidente," while waving national flags. Police fired tear gas to disperse protesters in several areas. A rally the night before left four people reported dead, an echo of tumultuous riots two years ago.

The opposition has been energized by young congress chief Guaido, who has led a campaign to declare Maduro a usurper and has promised a transition to a new government in a nation suffering a hyperinflationary economic collapse.

Guaido, in a speech before a cheering crowd, took an oath swearing himself in as interim president.

"I swear to assume all the powers of the presidency to secure an end of the usurpation," he said.

He has said he would be willing to replace Maduro with the support of the military and to call free elections.

The Trump administration told U.S. energy companies it could impose sanctions on Venezuelan oil as soon as this week if the political situation worsens, according to sources.

Maduro was inaugurated on Jan. 10 to another term in office following a widely boycotted election last year that many foreign governments described as a fraudulent. His government accuses Guaido of staging a coup and has threatened him with jail.