After the most divisive election in the 33 years since the end of the dictatorship in Brazil, former army captain Jair Bolsonaro has been elected Brazil’s 38th president.

A year ago he was unknown outside Brazil. Called "the Trump of the tropics", he has polarised Brazilian society in a fashion like what Donald Trump has done in the US.

Bolsonaro has already stated that he will abandon Lula’s much vaunted South-South co-operation, and we have yet to see what he will do about Brazil's membership of the Brics group

It is difficult to pin Bolsonaro down. For his supporters, he is the one who will end corruption and bring back law and order in Brazil. For his opponents he is a dictator in waiting, a misogynist, racist and homophobe, among other unflattering epithets.

So, why did he win? Brazilian society was fed up after years of corruption, which plunged the country into its worst recession in decades, and of violent crime. And they blamed the Workers Party, which governed Brazil from 2003 until the controversial impeachment of former president Dilma Rousseff in 2016.

Bolsonaro’s election promise that police would be allowed to shoot criminals, citizens would be allowed to bear arms and corrupt politicians would be locked up were music to the ears of Brazilians tired of having their future stolen by crooked politicians and violent criminals.

In a way, his election was about getting rid of the perceived cause of this misery, the Workers Party, once and for all. On the other hand, Bolsonaro's racist and generally horrifying statements towards minorities, women and the LGBTQ+ community, and open admiration for Brazil’s brutal dictatorship of the past and support for extrajudicial killings and torture — and his promise to allow further deforestation of the Amazon — have raised concerns about the future of the rule of law and democracy in Brazil.

Ironically, notwithstanding what he said about them, Bolsonaro enjoys considerable support among women, black people and the LGBTQ+ community.

During a campaign speechhe said, probably in jest, that he was going to shoot all supporters of the Workers Party and send them to Venezuela “because they think it is so good there” (a reference to a scaremongering myth that the Workers Party wanted to transform Brazil into a socialist state based on the Venezuelan model).

This raises the prospect that his anticorruption drive is just a guise to get rid of the Workers Party and its legacy. After all, he did say at a São Paulo gathering that once he was elected his opponents must either flee the country or go to prison. However, his appointment of stalwart anticorruption judge Sergio Moro (who jailed former president Luiz Inacio Lula da Silva on corruption charges) as minister of justice raises hope Brazil’s endemic corruption could finally come to end.

There is no denying that discontent with the left-wing Workers Party bears a huge responsibility for this swing to the right in Brazil, although they were hardly the only ones complicit in the billion-dollar corruption schemes that led to prison sentences for many of Brazil’s most prominent politicians and business people. The party justifiably complains that it has been singled out while others weren’t even prosecuted, although that doesn’t affect the validity of the action taken against those who were.

The Workers Party foolishly clung to Lula (who, despite being in prison, was actually leading the opinion polls) as its  presidential candidate after his conviction. Only a few weeks before the elections, when  party members realised Lula wouldn’t be allowed to stand for president, did they relent and put his running mate, Fernando Haddad, in his place.

By then it was too late, and they paid a heavy price for their intransigence. Lulu should have been dumped immediately after his conviction rather than defended with excuses such as that he was convicted without evidence, or that he is a political prisoner, to try and keep him as a candidate. The party clearly misread the mood of the electorate and paid dearly for that.

So, what does a Bolsonaro presidency mean for Africa?

During the Workers Party years Brazil grew close to Africa. Many of Brazil’s biggest companies now have offices in SA in a wide range of industries. Their investments in the rest of Africa are also significant, especially in Angola and Mozambique but also countries as diverse as Ghana and Egypt.

Brazil opened embassies in many African countries during that era, and Lula was hailed as a socialist hero whenever he travelled to the continent. Many of the investments in Africa were a result of incentives introduced by Lula. He certainly opened many opportunities for Brazilian businesses in Africa, and for SA businesses in Brazil.

What will happen now is difficult to predict. Since many of the relationships were fostered by Lula and the Workers Party, the hatred for them that has engulfed Brazil and been exploited by Bolsonaro could threaten the country's relationship with Africa.

He has already made it clear that his focus will be on Brazil's economic relationship with the US and he has confirmed that he will move Brazil’s embassy in Israel to Jerusalem (to the great acclaim of his millions of evangelical supporters and Israel's Benjamin Netanyahu). This is in sharp contrast to SA, which has downscaled its diplomatic presence in Israel.

In addition, Bolsonaro has already stated that he will abandon Lula’s much vaunted South-South co-operation, and we have yet to see what he will do about Brazil's membership of the Brics group. He has already indicated that China’s investments in Brazil will be reviewed, which could spell trouble for Brics as a whole.

In light of the uncertainty, it may be best to look at it from the perspective of cold facts. Brazilian companies make a lot of money in Africa. Bolsonaro is very friendly towards business and he is unlikely to undo anything that would prejudice Brazilian investments in Africa, irrespective of his views of the South-South policy of the Workers Party. He will probably take a similar transactional view of international relationships as Trump and not prejudice relationships that make money for Brazil.

Therefore, I think it is unlikely any Brazilian investments will be deliberately shut down. New investments may slow down, especially if more opportunities in the much more lucrative American market open up. For Africa, I believe in general it will be business as usual with Brazil.

Support for Bolsonaro among his followers is fanatical. It has become a matter of “if you’re not with us, you’re against us”. There is no midway. Any doubt expressed about Bolsonaro is akin to support for the reviled Workers Party, a blatant falsehood since it is possible, and quite reasonable, not to support either.

It also ignores the fact that all the corruption and other valid criticism aside, Lula and the Workers Party did bring about considerable improvements in Brazil, taking electricity, medical care, education and infrastructure to impoverished regions of the country for the first time.

The Workers Party was not the unmitigated disaster Bolsonaro and his followers make it out to be. It is one of history's great tragedies that the party and its allies succumbed to temptations of corruption, destroying what might otherwise have been a sterling legacy. For that they paid the ultimate price at the ballot box.

For SA, it is worth keeping in mind that many of the decisions Bolsonaro makes in future, including those concerning Brazil’s relationship with Africa and the Brics grouping, will be based on this “us versus them” mentality, rather than on reason.

• Myburgh is an attorney in Johannesburg and a member of the Brazilian Law Society.