About 70,000 persons gathered on a wind-swept hill here today to bury 18 black victims of political violence in one of the largest protest meetings ever held against white-minority rule in this country.

South Africa also appeared to be on the brink of new unrest in its essential mining industry. The black mineworkers' union, which begins a strike at seven gold and coal mines Sunday night, warned today that the three mining companies affected appeared to be preparing for "total warfare."

President Pieter W. Botha met in Cape Town for three hours -- nearly twice as long as scheduled -- with three European foreign ministers here to assess the political situation before a meeting to determine whether the European Community should impose sanctions against the Botha government. Reflecting the politically controversial nature of the visit, the United Democratic Front, a major opposition organization, refused to meet with members of the delegation.

At this bleak township on the outskirts of the port city of East London, it was a day of strong emotions and angry speeches that emphasized the rising militancy of South Africa's urban blacks following a year of intensifying violence that has claimed about 675 lives.

Police kept a low profile. Some watched the funeral with binoculars from a nearby school while a single armored vehicle was visible at the outskirts of the township.

There were passionate calls for new violence, most prominently from Steve Tshwete, regional president of the United Democratic Front, who had gone into hiding earlier this week after police came to his home to detain him.

He resurfaced today, telling the crowd they must "move forward and die . . . . We are going to burn this town. We are going to burn this whole country. We will destroy everything here and on the ashes of apartheid a new society will emerge."

There were bitter denunciations of capitalism and of the United States and praise for the outlawed African National Congress, the main underground resistance group fighting white rule, and for the banned South African Communist Party.

This region is called "the border" because it once marked the boundary between white pioneers and black tribes that fought seven wars for supremacy in the 19th century.

Under the leadership of the United Democratic Front, residents here have boycotted nonblack businesses for more than two months. Nonetheless, until recently political violence was minimal here, and East London was not in the area covered by the government's July 21 state-of-emergency decree, promulgated to deal with rising unrest.

Trouble started Aug. 12, the day after the funeral in a nearby township of slain civil rights lawyer Victoria Mxenge. A confrontation between police with shotguns and stone-throwing youths quickly spread over the course of three days, and when the violence subsided, at least 19 blacks were dead and more than 100 injured.

Among those killed were two boys, ages 13 and 11, and a 16-month-old baby who witnesses said died of asphyxiation when a tear gas canister was thrown into his house. His name was Siphiwe Goodboy Willi, and his small white coffin stood out poignantly among the 17 larger ones today.

Two weeks ago residents alleged that police opened fire without warning on a crowd at a vigil outside the home of a victim of the violence. Twenty-five more persons were wounded. Police said the crowd attacked first with rocks.

Today, grim-faced young men in black berets and khaki shirts carried the coffins into the crowded stadium, each man with one hand holding a casket, the other in a clenched-fist salute.

About 30,000 persons jammed the playing field, while far more than that number listened from outside.

Despite the cries for violence, this was a militant but disciplined crowd. Two black men were accused of being police informers and tires were placed around their necks as a prelude to a now established ritual of burning suspected informers alive. But funeral marshals quickly hustled the men away from knife-wielding youths to the stage, where the men spent the day under the protection of the clergy gathered there. Later they were taken out of the area quietly.

A smaller funeral gathering outside the western Cape Province town of Worcester was less peaceful. Police there fired rubber bullets and birdshot to disperse a crowd of 1,500. Police said they moved in after someone in the crowd had fired a shot and others threw stones.

Three more deaths were reported in mixed-race or Colored townships east of Cape Town today, bringing to 31 the official death toll in four days of violence there.

The National Union of Mineworkers, due to launch strikes involving 70,000 black workers at seven mines Sunday night, said today it had issued rules to its members to keep the strike peaceful. But union Secretary General Cyril Ramaphosa charged at a press conference in Johannesburg that the three companies involved were planning "military exercises against defenseless workers."

Ramaphosa said the companies had fenced in dormitories where workers live, distributed pamphlets threatening the dismissal of anyone who strikes and purchased "great quantities" of live ammunition, rubber bullets and tear gas. He said the companies also threatened to cut off water and food supplies to strikers, all of whom live on company grounds.

Ramaphosa warned that if such steps were taken the union might call a nationwide walkout.

The three companies strongly denied Ramaphosa's charges. A spokesman for Anglo Vaal said management had warned its workers of the possible consequences of a strike and charged that intimidation of workers by the union was "rife."