JOHANNESBURG, JUNE 3 -- The South African government, bolstered by an economic recovery fueled in part by rising gold prices, is increasing its police budget by about 50 percent and upping defense spending by a third in its annual budget, which Finance Minister Barend du Plessis presented in Parliament in Cape Town today.

The record, $23 billion budget reflects a comeback in the segregationist nation's economy since the crisis that forced it to freeze foreign loan repayments and impose exchange controls in September 1985 as racial unrest shook foreign investor confidence.

The government of President Pieter W. Botha is attributing the recovery to the tough security measures it introduced a year ago when it declared a state of emergency, moved troops into the segregated black townships and began detaining, without charges, an estimated 25,000 black activists.

In his budget speech today, du Plessis said it was clear that control of what he called "unrest and intimidation" in the black community should continue to have high priority.

The police budget would increase to $765 million and the defense budget to $3.3 billion. Most of the increase in defense spending was allocated to the Army, the branch most closely involved in internal security operations.

"The defense force is very much aware that a stable and healthy economy is just as much a prerequisite for a strong defense force as a strong defense force is a prerequisite for a healthy economy," du Plessis said.

The budget also provides more money for aid to the nominally independent black tribal "homelands" and local black councils, which are the apartheid system's substitute for giving the black majority political rights in the central government.

One major improvement was a 40 percent increase in the sum allocated for black education. The government has increased the amount spent on black schooling for several years, reflecting the country's need for increasing numbers of skilled black workers, but it remains insistent that education must be racially segregated.

Declaring that the economy was in an "upward swing" that was expected to continue, du Plessis said he was confident the increases in government spending could be financed without raising personal or business taxes.

A resurgence in the price of gold, of which South Africa is the world's biggest producer, has been the main factor in helping South Africa bounce back from its economic knock-down of 18 months ago and shake off the effects of U.S. sanctions imposed last year to try to force it to abandon apartheid.

Du Plessis revealed that the country's gold and other foreign reserves had improved from $1.9 billion to $3.6 billion in the past 12 months. Its rand currency, which crashed to a record low early last year, has improved 40 percent against the dollar, exports are up and the the balance of payments, which had shown a deficit of $1.1 billion in 1984-85, showed a $3.8 billion surplus for the first quarter of this year.

Economic specialists pointed out that du Plessis' ability to increase government spending without raising taxes was due in part to "fiscal drag" caused by the country's 16 percent inflation rate, which meant taxpayers were automatically being thrust into higher tax brackets.