One of the poorest nations in the world in 1960, Botswana gained independence in 1966 and has risen to become the fourth wealthiest nation in Africa. But, as the new film “A United Kingdom” vividly depicts, racism and political brinksmanship almost derailed its path to prosperity.

The immediate post-World War II era was marked by global instability as the Cold War teetered on the precipice of becoming hot. South Africa emerged as a power broker on the African continent as it implemented strict racial segregation through Apartheid. At the same time, indigenous African peoples such as the Bamangwato – in what is now Botswana – were agitating for independence.

Botswana’s independence was achieved in no small measure because of the leadership of Seretse Kama, king to the the Bamangwato people in the British Protectorate of Bechuanaland, which was encircled by South Africa.

Kama, however, did the unthinkable: He married a white English woman while studying law in London in 1946. His decision triggered an international crisis, a story told vividly and poignantly in “A United Kingdom.”

Kama, in a powerful performance by David Oyelowo ( “Selma”), embraced an openness and social liberalism that ran counter to the customs and traditions in European society, as well as his native Bamangwato people. This created a rift with his uncle, who also served as his guardian until he came of age, and other elders who expected him to choose a wife from among their tribe. Yet the elders reaffirmed his role as the king after a series of traditional public meetings.

Fearing that South Africa might invade Bechuanaland and seize potential mining sites because of the interracial marriage, the UK balked and exiled Kama from his native land in 1951. After five years in exile, Kama relinquished his role as king and returned as a private citizen.

This is where the film ends, even though Botswana’s history becomes infinitely more interesting. Keenly aware of Bechuanaland’s economic potential as a global source for minerals, Kama’s insights combine with his deep knowledge of the global economy to give him a farsighted vision for the Bechuanaland’s future.

Kama’s return to Bechuanaland a private citizen allowed him to enter into politics. He founded the Bechuanaland Democratic Party in 1961 and became Prime Minister of Bechuanaland after defeating socialist and Pan-African candidates in democratic elections in 1965.

Kama subsequently orchestrated progressive, market-oriented economic policies that emphasized export led development, entrepreneurship, incorporating the expertise and knowledge of foreigners, creating a favorable business environment for mining and natural resource development, and cultivating indigenous private enterprise. Botswana is ranked as one of the freest, and now wealthiest, economies in Africa.

In the film, Kama rallies his people to push for independence by re-purposing a quote from the Greek philosopher Epictetus: “No man is free who is not master of himself.”

In the film, this is interpreted as political freedom. But in practice Kama understood that personal freedom was essential for economic and social progress as well. Kama’s social liberalism and economic platform were two sides of the same coin.

Seretse Kama passed away in 1980 at the age of 59, but he was a man for our times. Botswana is fortunate that he was also a man ahead of his own times.