CARACAS—Venezuela may now have two presidents.

Lawmakers in the National Assembly on Tuesday voted to allow Juan Guaidó, a little known politician who heads the legislative body, to become the country’s “legitimate” leader rather than President Nicolás Maduro. The resolution says he must assume an interim presidency to head a transitional government and help organize new elections.

Although the move is largely symbolic, the lawmakers hope it will help rally the country’s dispirited opposition and win backing from the U.S. and other regional states from Brazil to Argentina that could freeze Venezuela’s bank accounts and other assets.

“With international backing to recognize him as president this could put the Venezuelan government in a squeeze,” said Luis Vicente Leon, a leading Venezuelan pollster and political analyst. “If the U.S. recognizes Guaidó as president, Venezuelan assets abroad will be out of the control of Maduro even though Maduro has power in Venezuela.”

Mr. Maduro began a second, six-year term last week after about 60 countries deemed Venezuela’s election last year a sham, since leading opposition candidates weren’t allowed to run.