BEIJING -- China teetered this morning on the edge of civil war, with troops presumed loyal to hard-line President Yang Shangkun in control of central Beijing but positioned defensively at strategic points in apparent anticipation of attack by rival forces.

Troops and armored vehicles were reported moving toward Beijing from the east, according to Western diplomats who said they appeared to be opposed to the troops of the 27th Army that killed hundreds or perhaps thousands of people while taking control of the center of the capital over the weekend.

A military attache in the British colony of Hong Kong, reached by telephone this morning, said the Chinese air force has joined the effort to wrest control of Beijing Faxes from the 27th Army. Infantry units of the air force landed at the Nanyuan military airport south of the capital Monday night and engaged in skirmishes with other military units at or near the airport, the attache said.

The air force believes that responsibility for the indiscriminate shootings in Beijing rests with the army, the attache said. The air force is headed by Wang Hai, who canceled a planned trip to Europe last week apparently to remain in Beijing during the intra-military feuding.

Other small-scale duels broke out between rival troops Monday, according to Western witnesses, only about one mile west of Tian An Men Square, now controlled by thousands of 27th Army soldiers with hundreds of armored vehicles.

Tanks Fan Out

At about 7 p.m. Monday, tanks accompanied by armored personnel carriers and truckloads of troops fanned out to points along the Second Ring Road that loops around the main part of the city. This area includes Tian An Men Square, the Great Hall of the People and Zhongnanhai, the red-walled compound from which China's leaders have traditionally ruled, and the city's older residential and commercial districts.

About 20 tanks continued to stand guard this morning at the Jianguomen bridge on the eastern side of the city, about half facing east in defensive positions. The others faced north, south and west to control access to the strategically important bridge, which crosses the Second Ring Road.

What was unfolding appeared to be a battle for control of Beijing and, in the broader sense, for control of China after the country's 84-year-old paramount political and military leader, Deng Xiaoping, passes from the scene. China's political leadership appeared to be in a virtual state of collapse, almost paralyzed by personal rivalries and differences over the use of force and terror against Beijing citizens.

Deng is generally believed to have ordered the bloody military crackdown, but he is also believed to be in rapidly failing health. It is widely believed that he suffers from prostate cancer. But there have also been rumors that he has suffered a stroke or died since his last appearance in public, which was the May 16 summit meeting with Soviet President Mikhail S. Gorbachev.

The troops now in control of central Beijing are more directly associated with Yang and high-ranking military members of his family. It appeared that the Chinese president, a veteran military leader in better health than Deng, was making a bid for supreme power.

Attempted Coup Seen

Some observers theorized that either President Yang had attempted to carry out a coup and Deng was succeeding in putting it down, or that Deng himself was responsible for ordering the carnage but had realized that the situation nationwide was getting out of control and was looking for scapegoats.

But one Chinese military source said that Deng, whose whereabouts are unknown, had not been in control of the military when the weekend massacre took place. This source said Deng is now believed to be reasserting control.

Some reports said that the 38th Army, a Beijing-area force that reputedly refused orders to suppress the pro-democracy demonstrations that touched off the current crisis, was being ordered to retake the city from the troops that moved in over the weekend. The 38th Army is believed to have strong ties to the reformist general secretary of the Communist Party, Zhao Ziyang. Zhao appears to have been stripped of power for his refusal to take a hard line with the students. His current fate is unknown but he has been presumed to be under house arrest.

Some Troops Unwilling

Within Beijing, there were various indications that not all troops were willing to participate in the martial-law crackdown ordered by hard-line Premier Li Peng on May 20.

About 100 military vehicles, including armored personnel carriers and troop trucks, were abandoned by soldiers on the west side of the city during the predawn hours Monday and later set afire by residents. Crowds around the charred vehicles reported that the soldiers who had left them and taken refuge at a nearby museum compound had said they were unwilling to fire on unarmed crowds.

Closer to the city center, shooting broke out between two groups of troops near the Minzu Hotel, only about one mile west of Tian An Men Square.