China charged yesterday that more than 200 Vietnamese troops occupied a ridge in Chinese territory Friday after attacking border guards in a skirmish that left at least six persons dead and dozens injured.

Both sides traded official protests Friday and conflicting charges over the incident, each accusing the other of starting it.

The reported killings and invasion make the incident the most serious yet in the feud between the two communist neighbors.

The fighting took place in the vicinity of Friendship Pass, where thousands of ethnic Chinese trying to flee Vietnam have been held up by stiff new Chinese border regulations.

Diplomatic sources have said that Vietnamese and Chinese troops engaged in a bloody clash with several fatalities in February, but that was before the two sides brought their conflict out into the open in a full-scale propaganda war. The earlier clash has never been confirmed.

The official New China News Agency said that late Friday afternoon, "The Vietnamese side flagrantly sent over 200 Vietnamese Army men with bludgeons, stones, submachine guns, hand grenades and daggers to launch attacks from three directions on China's Bo Nien Ridge."

The official Chinese news release, as received here, said Chinese personnel did not counterattack. The agency indicated that the Vietnamese had intruded a small distance into Chinese territory in an area where there had been disagreement over the location of boundary lines.

When the Chinese authorities at the border lodged "a stern verbal protest with the Vietnamese side" over the attack on the ridge, the Vietnamese troops "even swarmed into the Chinese border and beat up nine Chinese officers" who were unarmed, according to the Chinese account. The Chinese release said the Vietnamese were still in Chinese territory as of about midnight Friday.

Vietnam made no immediate response to the Chinese charges that Hanoi's troops had crossed the border. An earlier Vietnamese account said that the Chinese had triggered the incident by attacking Vietnamese border guards in Dong Dang on the Vietnamese side.

Both sides have a history of giving widely varying accounts of incidents that have flared on the border since thousands of ethnic Chinese began pouring out of Vietnam earlier this year.

In the fighting Friday, for instance, the official Vietnam News Agency said hundreds of Chinese soldiers and police in civilian clothes temporarily crossed the border and joined "hooligans" among the Chinese refugees stalled at the border in an attack on Vietnamese border personnel. Two Vietnamese were killed and 25 wounded, Hanoi's news agency said.

The official Chinese version of the incident said 100 to 200 Vietnamese soldiers and police attacked the ethnic Chinese refugees camped on the Vietnamese side of the border, killing four and wounding dozens of others.

In the past several months, an estimated 160,000 to 170,000 ethnic Chinese residents of Vietnam have crossed the border into China. They said they were escaping both hardships under the war-ravaged Vietnamese economy and what they said was government-sponsored discrimination against ethnic Chinese.

Since Vietnam began open warfare with its small neighbor. Cambodia, one of China's closest allies, Hanoi has demanded special tests of loyalty from its Chinese citizens. The harsh treatment of Chinese in Vietnam has only exacerbated the distruct Peking feels toward Hanoi because of close Vietnamese relations with the Soviet Union, China's arch rival.

On July 12, Peking closed its border to all ethnic Chinese refugees but those few who had managed to get formal exit and entry papers from the Vietnamese government and the Chinese Embassy in Hanoi.

A makeshift camp of refugees unable to cross over into China began to build up on the Vietnamese side of the border, creating great tension and leading to several incidents of violence. Peking said its facilities for handling refugees were stretched to the limit and asked the refugees at the border to return to Hanoi to get the proper papers.

At talks in Hanoi called to solve the refugee problem, the Chinese side repeatedly asked the Vietnamese to stop harassing ethnic Chinese and allow them to remain in Vietnam. Hanoi repeatedly denied that its Chinese residents were being harassed. Both sides disagreed on how many of the estimated 1.7 million ethnic Chinese residents of Vietnam could be considered Vietnamese citizens.

Although both sides have indicated that they have taken special military precautions in the border area, they have so far not allowed the violence to spread much beyond the border checkpoint areas. They have instead used the dispute to inspire reams of propaganda directed at what each considers to be its principal enemy. In Vietnam's case that is Cambodia and in China's case, the Soviet Union.

China's heavily publicized plan to evacuate refugees from Vietnam by sea was at least temporarily aborted when Hanoi announced conditions for the docking of the ships that Peking would not accept. The talks in Hanoi, although at first thought to offer some chance for an agreement, have apparently gotten nowhere.

They have been further marred by incidents such as a violent clash between Chinese refugees and Vietnamese police at a Hanoi hotel and rail station shortly after the talks began.