In 1986, the United States sanctioned South Africa. This was some 40 years after the beginning of apartheid, the government-sanctioned policy of separating citizens into different facilities, schools, and institutions based solely on race.

Today, three decades later, South Africa is no longer an international pariah. Instead, the nation is among the most popular tourist destinations in the world; three cities, Johannesburg, Cape Town, and Durban, saw close to six million visitors in 2016 alone. South Africa also routinely makes all the manner of bucket lists and must-see lists.

So what changed? How did the nation go from international pariah to tourism superstar?

In a nutshell, rebranding, political change, and some serious financial incentives.

Political Change

The most obvious factor for South Africa’s transformation lay, of course, in politics.

First, apartheid ended. At the risk of simplifying a long and difficult struggle, one factor came from the sanctions levied on the nation by much of the world. Even if these restrictions didn’t hurt South Africa’s economy (at least not visibly), the psychological impact was far worse: boycotting South Africa essentially signified that it was not part of the international society, a stinging rebuke to a country that desired to engage with the world at large.

Still, none of this would have been possible without resistance from the part of black South Africans. Incidents such as the Soweto Uprising, brutally suppressed by government forces or the earlier Sharpeville Massacre cemented the reputation of the South African government as an oppressive regime. The image of dead students from Soweto or the corpses of protesters at Sharpeville did much to sway international opinion. People in countries from Britain to the United States demonstrated in solidarity with black South Africans, forcing their governments to isolate South Africa.

Eventually, FW de Klerk, the Afrikaner president of South Africa, made overtures to Nelson Mandela, the imprisoned leader of the African National Congress.

The rest is history.

Mandela’s 1994 election was a watershed moment for the nation, and perhaps the first indication that it was actively working to overturn its racist history. In the elections, Mandela and his party won 62.65 percent of the vote; more importantly, Mandela and the ANC formed a unity government, and rather than pursuing vendettas from the long fight for independence, forged forward.

Rebranding

Ending apartheid (politically, at least) was only the beginning. The nation had long been famous for its beauty, be it rolling savannahs, landscapes that sat at the edge of sea and sky, and incredibly diverse culture.

As a result, South Africa rebranded itself. As Sarah Khan points out in a piece for Conde Nast Traveler, the government did a few things right. First, they refused to suppress memories of apartheid, instead memorializing it through museums at Robben Island and Johannesburg. Next, in a stroke of clever marketing, South Africa hosted the 1995 Rugby World Cup–a moment of glory and triumph immortalized in the 2009 film Invictus.

Though hosting the Rugby Worlds was only the first in a series of international sporting events (it was later followed by the 2010 FIFA World Cup), it marked a major milestone for the nation: the successful transition from pariah to full-fledged member of the international community. That’s not to say that social and economic challenges disappeared overnight; after all, inequality persists in South Africa, and the nation is still deeply divided in a number of other ways. Still, international legitimacy brings with it serious economic benefits–ones which the nation’s burgeoning tourism sector quickly snapped up.

Financial Incentives

Lastly, tourism has seen a strong performance even amidst a financial recession. In 2017, despite an overall state of economic crisis, marked by high unemployment (27.7 percent) and a junk credit rating, foreign spending on tourism rose to $1.4 billion compared to previous years. Much of this was driven by Cape Town, arguably the country’s strongest tourist attraction; the city expects a 13 percent increase in tourist arrivals in 2017. Tourism also accounts for 4.5 percent of the nation’s employment–significant considering the rapid growth of the industry.

Part of this is due to clever marketing. Playing off the nation’s storied relationship with Australia (most notably their rugby rivalry), the South African national tourism board recently released a playful ad skewering Australia’s tourism agency, comparing pricey Australian beers and soggy sausage sandwiches to cheap, nearly free beers and massive braai barbecues.

But this cheeky, sassy ad isn’t alone. South African Tourism is well known for its spirited, unique videos. One collaboration with FCB Africa yielded a beautiful, funny, and ultimately moving tale of Bheki, a Xhosa dressmaker who travels across the country to find inspiration for a very wealthy bride-to-be. Along the way, Bheki experiences a grand panorama of the unique nation–and meets his own sweetheart in the process. During the production of the video, South African Tourism also solicited ideas from crowds through social media, making the video that much more heartfelt.

South Africa has come a long way from international outcast. Though the country isn’t perfect, it has gone on to win a place in the hearts and minds of millions of travelers. Thanks to its innovative marketing, strong tourism sector, and political change, South Africa routinely finds itself listed on bucket lists and best of tourism slideshows.