South Africa's respected finance minister, Pravin Gordhan, is in the clear after the country's chief prosecutor dropped fraud charges against him.

The prosecutor announced the fraud charges just three weeks ago, rocking the domestic stock market and the South African currency. On Monday, he withdrew all charges, causing the rand to rally about 2%.

The original decision to prosecute Gordhan and his two former colleagues at the South African Revenue Service led to an outcry.

The move was slammed by civil society groups, opposition leaders, and even senior members of the country's ruling political party, the African National Congress. More than 80 CEOs wrote an open letter in support of the finance minister.

Gordhan denied wrongdoing and described the allegations against him as "political mischief."

There is deep suspicion in many quarters that the move to prosecute Gordhan was politically motivated by President Jacob Zuma's intention to take control of the Treasury.

That has been repeatedly denied by the president's office and the national director of public prosecutions, Shaun Abrahams.

Abrahams was defiant in a press conference on Monday, saying he would not resign over the matter.

"I certainly do not owe anybody an apology," he said.

The original fraud charges related to Gordhan authorizing an early retirement package for his deputy in 2010, when he was head of the country's revenue service. In the last week, key documents emerged showing Gordhan was advised that the move was legal.

The African National Congress released a statement Monday saying it stood behind Gordhan and noted that the fraud case "had a negative impact on the economy."

Related: Wild weather means the world will have less wine to drink

Zuma brought in Gordhan for a second stint as finance minister in December 2015 after making a major political misstep.

At the time, Zuma had ousted finance minister Nhlanhla Nene, and replaced him with a little known lawmaker, which freaked out markets and angered many South Africans.

In a bid to restore calm and steady the plunging rand, Zuma appointed Gordhan back into his finance minister role, which he had held between 2009 and 2014.

Zuma currently faces nearly 800 counts of corruption, though the National Prosecuting Authority has fought to avoid prosecuting the president in the courts. Zuma denies those allegations.

Related: The world's best university costs just $12,000 a year

Gordhan recently returned from an international roadshow aimed at convincing investors that South Africa is a safe and stable place to invest. The country has been losing favor with investors due to political scandals and a weak economy.

Unemployment is close to 27%, and the country is buckling under weak commodity prices, a drought and public protests.

Ratings agencies are in the midst of deciding whether to downgrade South African debt to junk status later this year, a move that Gordhan has been tasked to avoid.