Thousands of mourners gathered here today to bury nine victims of the latest round of violence in the troubled western Cape area, including three youths killed in a controversial police ambush here.

The funerals climaxed a week in which South Africa's 14-month-long political turmoil took an ugly new turn, with police in this area using live ammunition and hard-line tactics while blacks attacked six white policemen and soldiers and rampaged in a white business district, in Johannesburg, for the first time.

Two white policemen were wounded by gunfire in this area, three more stabbed in Johannesburg and a white soldier was lured from an armored personnel carrier and stabbed to death by a mob outside Port Elizabeth, in eastern Cape Province. They are some of the first casualties among white security forces since the unrest began.

Meanwhile, the white-minority government stuck to its defiant stand, with President Pieter W. Botha curtly dismissing a request from Colin Eglin, a white opposition leader, that he personally intervene here by meeting with black and mixed-race community leaders "before it is too late."

Today's three funerals, all of which took place in the windswept townships east of Cape Town, had an ecumenical and interracial flavor. Among the victims were five blacks, three Coloreds, as South Africans of mixed race officially are designated, and a Moslem, all of them shot by police during the past week. They are among the more than 750 persons to have died in violence since September 1984.

The Islamic funeral was the largest and most unusual in this Christian-dominated country. About 10,000 Moslems turned out to bury Abdul Karriem Friddie, 29, who was shot by police while leaving a protest meeting at a mosque. His death set off angry retaliation in which the two white policemen were shot and wounded.

It was the largest funeral in a decade for Moslems, mostly the descendants of Malay slaves shipped here in the 17th century. The mourners hauled the coffin to a sports field, where they placed it alongside rugby goalposts, removed their shoes and faced northeast toward Mecca to pray. A police helicopter circling above nearly drowned out the prayers, but otherwise police maintained a low profile throughout the day.

But the mourners also welcomed the appearance of Christian clergymen at the ceremony and cheered calls for solidarity.

They also applauded a statement read on behalf of the United Democratic Front, an activist coalition that has much support here. It included a warning "to all those people who are middle-of-the-roaders -- if you sit on the fence, you are going to be hurt on both sides."

Earlier in the day, three Colored youngsters, aged 11, 16 and 18, were buried at a nearby cemetery. They were killed Tuesday by police hidden in crates on a flatbed truck.

The authorities used the truck as a decoy, slowly parading it up and down a main street in this mixed-race township until it attracted stone-throwers. Then police popped up from the crates and opened fire with pump-action shotguns, killing the three youths and wounding about 15 others.

Police have sought to justify the ambush, saying repeated stone-throwing had endangered motorists' lives throughout the area in recent weeks. But speakers at today's funeral denounced the slayings as "murder" and "carnage" and said that they were further evidence of the illegitimacy and brutality of the government.

The three white coffins, surrounded by weeping relatives and school classmates of the victims, first were taken to a black Methodist church here this morning. Hundreds crammed the church or waited outside, including dozens of Moslems who came to express sympathy.

The service had the air of the American civil rights era, with mourners singing "We Shall Overcome" and interjecting "amens" and other responses to angry, rhythmic bursts of oratory from nearly a dozen speakers, all of them clergymen.

There were Bible passages and a prayer for the government's downfall, as well as outlawed freedom songs. There was also a taped message from the Rev. Allan Boesak, the Colored leader who faces charges of subverting the state and whose bail conditions prohibit his appearance at such gatherings.

"Every time our children die, the true nature of the South African government is exposed," Boesak said.

A few hours later several thousand mourners in the black township of Guguletu held a ceremony for five victims of violence.

In replying to opposition spokesman Eglin, Botha cited his government's "reform" program and suggested that Eglin's Progressive Federal Party had contributed to the unrest by meeting a week ago with the outlawed African National Congress in Zambia.

Eglin, the national chairman of the party, the main opposition in South Africa's whites-only parliamentary body, said Botha's response was "utterly depressing" and failed to recognize "the extent of the damage which the actions of his government and its agents are doing to the fabric of society in this part of the country."

Meanwhile, downtown Johannesburg returned to normal after yesterday's brief outburst of black rioting following a memorial service for Benjamin Moloisi, a black nationalist executed yesterday.