Mr. Pompeo played an important role during a trip early this month to Brazil and Colombia, said a person with connections to opposition leaders in Venezuela. Mr. Pompeo signaled to leaders in both countries that if Latin American nations came up with a reasonable plan on Venezuela, the United States would stand with them, this person said. That was one factor that contributed to Canada and 12 Latin American nations issuing a statement on Jan. 4 that said they would not recognize Mr. Maduro’s presidency.

The statement was stronger than even American officials had expected, the person said. Mr. Pompeo has also been in close contact with Chrystia Freeland, the Canadian foreign minister, who has played a leading role in rallying global criticism of Mr. Maduro. On Jan. 16, the two spoke by phone about Venezuela, among other issues.

Mr. Trump’s tough stand this week drew some bipartisan support. Representative Adam B. Schiff, Democrat of California and one of the president’s strongest critics, called the recognition of Mr. Guaidó “an appropriate step to support the democratic aspirations of the Venezuelan people.”

But like others, Mr. Schiff noted the disparity between Mr. Trump’s approach to Mr. Maduro and other autocrats. “We must also remember that America’s support for democracy and human rights must apply universally if it is to be credible,” he said.

That was not Mr. Trump’s view when he came to office. In his first foreign trip as president, Mr. Trump told an audience in Saudi Arabia that he would not dictate how other countries treat their own citizens. “We are not here to lecture,” he said. “We are not here to tell other people how to live, what to do, who to be or how to worship.”

Just last month, Mr. Trump abruptly ordered the withdrawal of troops from Syria, arguing that the United States’ only interest there was fighting the Islamic State. He offered no criticism of President Bashar al-Assad of Syria, who has waged war against his own citizens, resulting in hundreds of thousands of casualties and millions of displaced people.

“Does the USA want to be the Policeman of the Middle East,” Mr. Trump asked then on Twitter, denouncing the notion that the United States had a role to play “protecting others” in the region.