'My reasons for doing so are personal and there are no questions of policy involved,' he said in a statement.
President Nelson Mandela said later he had appointed a prominent banker, Christo Liebenberg, to replace Mr Keys. Mr Liebenberg, 60, retired in February as chief executive officer of the Nedcor banking group, the fourth biggest in South Africa.
Mr Keys, 62, was head of the country's second biggest mining group, Gencor, when in 1992 he was appointed minister of trade and industry by the then white president, F W de Klerk, and a few months later also became finance minister. He was retained by Mr Mandela in the new government of national unity when it was formed in May. On 22 June he presented the 1994/95 budget.
'We realise the importance of leaving the department, the portfolio, of finance as it is - without interference,' Mr Mandela said in May, acknowledging the sensitivity of the post.
Mr Keys originally took over an economy battered by sanctions, drought and political violence, and in the following two years steered it out of its worst recession on record.
South Africa's bond market and the financial rand, a prime measure of foreign investor confidence, fell on the report of his resignation. Industrial shares were shaken in late trade.
Initial rumours of the resignation sparked a large sell-off in the bond market in which yields on long-dated bonds slid more than 40 points. The financial rand dived to 4.95 on the dollar from 4.725 on Monday before recovering slightly to end at 4.925.
Dealers said the financial rand was jittery, and the market had been anxiously awaiting news about Mr Keys' replacement. A senior trader said before Mr Liebenberg's appointment: 'If it's a political choice, that will be bad news for the finrand. But if it's someone from the banking sector - as the rumour goes - then the finrand will move back down to where it started.'
A source close to Mr Keys said: 'The fact that there was strong lobbying for him to be retained reflected the enormous respect that he has.'