Barack Obama’s visit to Cuba is the first by a US president since Calvin Coolidge went in 1928. American investors, expat Cubans, tourists, scholars, and scam artists will follow in Obama’s wake. Normalization of the bilateral relationship will pose opportunities and perils for Cuba, and a giant test of maturity for the United States.

The Cuban Revolution led by Fidel Castro 57 years ago was a profound affront to the US psyche. Since the founding of the US, its leaders have staked a claim to American exceptionalism. So compelling is the US model, according to its leaders, that every decent country must surely choose to follow America’s lead. When foreign governments are foolish enough to reject the American way, they should expect retribution for harming US interests (seen to align with universal interests) and thereby threatening US security.

With Havana a mere 90 miles from the Florida Keys, American meddling in Cuba has been incessant. Thomas Jefferson opined in 1820 that the US “ought, at the first possible opportunity, to take Cuba.” It finally did so in 1898, when the US intervened in a Cuban rebellion against Spain to assert effective US economic and political hegemony over the island.

In the fighting that ensued, the US grabbed Guantánamo as a naval base and asserted (in the now infamous Platt Amendment) a future right to intervene in Cuba. US Marines repeatedly occupied Cuba thereafter, and Americans quickly took ownership of most of Cuba’s lucrative sugar plantations, the economic aim of America’s intervention. General Fulgencio Batista, who was eventually overthrown by Castro, was the last of a long line of repressive rulers installed and maintained in power by the US.

The US kept Cuba under its thumb, and, in accordance with US investor interests, the export economy remained little more than sugar and tobacco plantations throughout the first half of the twentieth century. Castro’s revolution to topple Batista aimed to create a modern, diversified economy. Given the lack of a clear strategy, however, that goal was not to be achieved.

Castro’s agrarian reforms and nationalization, which began in 1959, alarmed US sugar interests and led the US to introduce new trade restrictions. These escalated to cuts in Cuba’s allowable sugar exports to the US and an embargo on US oil and food exports to Cuba. When Castro turned to the Soviet Union to fill the gap, President Dwight Eisenhower issued a secret order to the CIA to topple the new regime, leading to the disastrous Bay of Pigs invasion in 1961, in the first months of John F. Kennedy’s administration.

Later, the CIA was given the green light to assassinate Castro. In 1962, Soviet leader Nikita Khrushchev decided to forestall another US invasion – and teach the US a lesson – by surreptitiously installing nuclear missiles in Cuba, thereby triggering the October 1962 Cuban missile crisis, which brought the world to the brink of nuclear annihilation.

Through dazzling restraint by both Kennedy and Khrushchev, and no small measure of good luck, humanity was spared; the Soviet missiles were removed, and the US pledged not to launch another invasion. Instead, the US doubled down on the trade embargo, demanded restitution for nationalized properties, and pushed Cuba irrevocably into the Soviet Union’s waiting arms. Cuba’s sugar monoculture remained in place, though its output now headed to the Soviet Union rather than the US.

The half-century of a Soviet-style economy, exacerbated by the US trade embargo and related policies, took a heavy toll. In purchasing-power terms, Cuba’s per capita income stands at roughly one-fifth of the US level. Yet Cuba’s achievements in boosting literacy and public health are substantial. Life expectancy in Cuba equals that of the US, and is much higher than in most of Latin America. Cuban doctors have played an important role in disease control in Africa in recent years.

Normalization of diplomatic relations creates two very different scenarios for US-Cuba relations. In the first, the US reverts to its bad old ways, demanding draconian policy measures by Cuba in exchange for “normal” bilateral economic relations. Congress might, for example, uncompromisingly demand the restitution of property that was nationalized during the revolution; the unrestricted right of Americans to buy Cuban land and other property; privatization of state-owned enterprises at fire-sale prices; and the end of progressive social policies such as the public health system. It could get ugly.

In the second scenario, which would constitute a historic break with precedent, the US would exercise self-restraint. Congress would restore trade relations with Cuba, without insisting that Cuba remake itself in America’s image or forcing Cuba to revisit the post-revolution nationalizations. Cuba would not be pressured to abandon state-financed health care or to open the health sector to private American investors. Cubans look forward to such a mutually respectful relationship, but bristle at the prospect of renewed subservience.

This is not to say that Cuba should move slowly on its own reforms. Cuba should quickly make its currency convertible for trade, expand property rights, and (with considerable care and transparency) privatize some enterprises.

Such market-based reforms, combined with robust public investment, could speed economic growth and diversification, while protecting Cuba’s achievements in health, education, and social services. Cuba can and should aim for Costa Rican-style social democracy, rather than the cruder capitalism of the US. (The first author here believed the same about Poland 25 years ago: It should aim for Scandinavian-style social democracy, rather than the neo-liberalism of Ronald Reagan and Margaret Thatcher.)

The resumption of economic relations between the US and Cuba is therefore a test for both countries. Cuba needs significant reforms to meet its economic potential without jeopardizing its great social achievements. The US needs to exercise unprecedented and unaccustomed self-control, to allow Cuba the time and freedom of maneuver it needs to forge a modern and diversified economy that is mostly owned and operated by the Cuban people themselves rather than their northern neighbors.