South Africa edged closer to a recession Wednesday on news that the economy had shrunk by 1.2 percent in the first three months of 2016 amid a fall in production at the country's mines.

South Africa's statistics agency said mining, which contributes nearly 8 percent to gross domestic product, fell 18.1 percent in the first quarter as worldwide demand for commodities remained low.

Growth was also hit by a protracted drought, with agriculture, which makes up 2.2 percent of GDP, shrinking for the fifth consecutive quarter. Agricultural production has fallen by 14 percent since the fourth quarter of 2014.

The economics figures were released as credit ratings agency Fitch released its latest assessment of South Africa's economy by leaving the country's rating unchanged at "BBB-", one level above junk status.