President Pieter W. Botha lifted South Africa's seven-month state of emergency today and freed 329 political prisoners. Despite this attempt to improve the country's image, Britain's biggest bank, Barclays, announced that it would make no new loans nor reschedule Pretoria's existing debts.

An Information Ministry statement said the ending of the emergency served to terminate special restrictions on media coverage of racial violence in the segregated black townships, but the government ordered the expulsion today of the bureau chief and two staff members of CBS television for defying those restrictions Wednesday.

Home Affairs Minister Stoffel Botha, ordering that the correspondents leave by midnight Tuesday, said they were being expelled because CBS had televised a mass funeral of 17 victims of violence in Johannesburg's black township of Alexandra on Wednesday -- a day after President Botha announced that the emergency would be lifted today -- in "flagrant contempt" of a court ban.

A proclamation signed by the president brought the emergency to a formal end early this morning in 25 towns and cities where it still applied.

Its removal was applauded by western diplomats and members of the white liberal opposition. But activist organizations warned that discontent in South Africa's black townships was still at a volatile level and that a return to calm was unlikely.

An official police report showed that there were another seven incidents of racial violence in various parts of the country today, with two more deaths reported.

There was also a second explosion in three days in a major Johannesburg police station when a limpet mine ripped through a district headquarters tonight. An official report said no one was injured.

On Tuesday, moments before Botha announced that the emergency was to be lifted, an explosion shook the city's main police headquarters, injuring four persons.

According to an estimate of the respected Institute of Race Relations, 670 persons died during the 228 days of the emergency.

Beginning at 2 a.m. today, the 329 political prisoners were driven from prisons and police stations and set down at random points in the townships where they live.

They were the last to be released of a total of 7,996 persons detained without charges under the emergency regulations proclaimed last July 21. Another 38 are still being held awaiting trial, 30 on charges of assaulting a prison guard and eight on charges of "public violence."

There were scenes of jubilation at a civil rights center in downtown Johannesburg this afternoon as a number of the freed prisoners, including some who had been detained for the full seven months, gathered for a press conference.

They looked well and appeared relaxed, but four said they had been assaulted by police during the early stages of their detention.

The decision by Barclays Bank of Britain to stop all future loans to South Africa and not to reschedule its $1.2 billion in existing loans has shaken the Botha government and business circles here. It prompted warnings that the optimism that followed an informal agreement reached last month on a rescheduling of South Africa's foreign debt may have been premature.

Barclays has now declared that it will not accept that arrangement, and there are fears that other banks may follow.

South Africa's leading financial newspaper, Business Day, said in a front-page report today that the decision had dashed hopes of a gradual return to international money and capital markets.

The shock is particularly great because Barclays has nearly a 50 percent share in South Africa's biggest commercial bank, Barclays National Bank, and for years has withstood pressure from antiapartheid groups in Britain to end or at least reduce its involvement here.

Finance Minister Barend du Plessis declined to comment on the decision today, saying he would meet soon with Barclays' chairman, Timothy Bevan, to discuss it.

The turning point in Barclays' close relationship with South Africa came last November when Bevan launched a broadside attack on apartheid, describing it as "repugnant, wrong, un-Christian and unworkable."

His sudden announcement of the loan ban came yesterday at a routine meeting in London.

Saying that Barclays wanted "to see an end to the bankrupt policy of institutionalized racial discrimination," Bevan set as conditions for granting new loans the scrapping of apartheid and a clear indication by the Pretoria government that it can reduce its foreign debt.

CBS bureau chief William Mutschmann said today that the home affairs minister had agreed to meet with him and his two expelled colleagues, correspondent Allen Pizzey and photographer Wim de Vos, Monday "so that we can present our case. I am hopeful that there is still an opportunity to reverse the decision," he added.

But a statement by Stoffel Botha tonight seemed to leave little room for retraction. Noting that CBS had televised the Alexandra funeral after losing a court application to nullify the prohibition on TV cameras in the township, the minister said the three were being expelled for "flagrant contempt" of the court decision.