President Obama speaks at the University of Yangon during his historical first visit to Burma on Nov. 19, 2012. (Paula Bronstein/GETTY IMAGES)

President Obama’s trip to Cuba next month comes more than three years after he made an equally symbolic — and politically risky — visit to another isolated, authoritarian state on which his administration had staked its foreign policy credibility

Last fall, the White House was rewarded when millions of Burmese participated in democratic elections and handed a landslide victory to the long-oppressed opposition party.

While the president’s trip to Burma, also known as Myanmar, in November 2012 does not perfectly mirror his opening to Cuba, there are important similarities.

“The core parallel is that we believe that the policy of not engaging Burma and Cuba was not working in either case,” Benjamin Rhodes, a White House deputy national security adviser, said Thursday. The political environment in Burma and its path forward were turbulent when Obama went, he said, but “the president traveled to Burma twice even when those questions were still very much in play. Our judgment is you don’t wait until the story’s over to show up and find out what happened. That just puts us on the sidelines.”

The Obama administration’s engagement strategy represents a sharp break from the George W. Bush administration’s “with us or against us” approach to foreign policy. And it has come to define the worldview of Obama in his eighth, and final, year in office.

The Iran nuclear deal with six world powers, led by the United States; a U.S.-China climate deal to scale back carbon emissions; and a 12-nation Pacific Rim free-trade pact, which includes communist Vietnam, represent the administration’s most cherished foreign policy accomplishments. All were locked in during the president’s second term, after years of diplomatic efforts to coax and prod the other participants to the negotiating table. (The trade pact still requires congressional approval.)

In each case, as with Burma and Cuba, the administration faced fierce criticism from lawmakers and human rights advocates who said that the White House was too eager to negotiate with traditional U.S. enemies. And in each case, the outcome remains fraught with the potential for failure and political blowback, as well as damage to Obama’s legacy.

In Malaysia, for example, Obama’s efforts to forge closer political ties — he golfed with Prime Minister Najib Razak in Hawaii in 2014 — have been frayed by allegations that Najib embezzled hundreds of millions of dollars and subsequently cracked down on political dissent.

“There’s no doubt that this transition in Cuba will be bumpy and there will be setbacks along the way,” said Simon Rosenberg, founder of New Democrat Network, a liberal think tank, who supports the administration’s strategy. “It’s going to take a generation.”

That was Obama’s message when he landed in Rangoon, the old capital of Burma, just weeks after his reelection in 2012. During a speech at the University of Yangon, the president called his visit a fulfillment of his 2009 inaugural vow to “extend a hand” to despotic regimes that unclench their fists.

“I’ve come to keep my promise,” Obama said. Thousands of schoolchildren lined the streets to greet his motorcade.

Noting the political reforms made by Burma’s ruling military junta, which had freed longtime democracy icon Aung San Suu Kyi after 15 years of house arrest in 2010, Obama added: “The flickers of progress that we have seen must not be extinguished — they must be strengthened; they must become a shining North Star for all this nation’s people.”

Ahead of the president’s trip, however, there was concern within the administration that the visit was premature. Lawmakers, including Sen. Mitch McConnell (R-Ky.), then the Senate minority leader, warned against an easing of economic sanctions. Human rights advocates highlighted ongoing ethnic violence against the Rohingya Muslims.

But Obama’s top foreign policy advisers — including Hillary Clinton, then the secretary of state — concluded that the time was right to engage the military-backed president, Thein Sein, who was installed in 2011 after the junta was officially dissolved. He and his backers had signaled their concern about China’s creeping influence and an openness to economic investment from the West.

Obama announced at a regional summit in Bali, Indonesia, in November 2011 that Clinton would within days become the first U.S. secretary of state in more than 50 years to visit Burma. The administration opened an embassy in Rangoon the following year.

“There was a sense that there was a ripening taking place in the country, and a U.S. opening could give it momentum,” Rhodes said last November at a Washington think tank, reflecting on the decision just days ahead of Burma’s parliamentary elections.

A few days later, Suu Kyi’s National League for Democracy won an overwhelming victory at the polls; she remains in negotiations over a transfer of power that could give a major boost to Obama’s Asia strategy. The estrangement between the United States and Burma had hampered the administration’s effort to deepen ties with the Association of Southeast Asian Nations, a 10-country bloc that is seen as a hedge against China’s growing influence in the region.

This week, Obama played host to leaders from those nations, including Burma, at a two-day summit in California.

Foreign policy analysts credit the administration for capitalizing on an opportunity, but they emphasized that Burma made its own decision to pursue reforms.

“The Burmese had fallen too far backward and believed they had to step into the modern world, or they would be vulnerable and abused by China,” said Ernest Bower, a Southeast Asia expert at the Center for Strategic and International Studies.

By contrast, the Castro regime in Cuba has shown no willingness to move toward open, monitored elections after half a century in power. But Havana in 2014 released a U.S. government contractor, Alan Gross, who had been held since December 2009, and the regime has signaled an openness to increased business investment and tourism from the United States.

Asked whether Cuba represents a greater challenge than Burma, Rhodes acknowledged that Suu Kyi’s long-standing political influence aided the U.S. efforts. “Whereas in terms of the politics in Cuba, you have a one-party system and then elements of opposition,” he said. “It’s not analogous.”