BEIJING -- Chinese leaders Friday ordered soldiers into Beijing to attempt to restore order after a month of massive pro-democracy demonstrations, but residents swarmed to block the army's way.

By 8 a.m. today, more than 10 hours after the army advance began, the soldiers had made little headway into the city. Massive crowds swarmed around the army trucks, deflating tires and driving dump trucks and other heavy equipment into place to prevent them from moving.

Beijing Mayor Chen Xitong declared martial law in the urban areas of Beijing effective at 10 a.m. today. The order bans demonstrations, public petitions, strikes, boycotting of classes, spreading of rumors and distributing leaflets.

Networks Cut Off

The government ordered the Cable News Network to halt TV transmissions, and the American network ended its live coverage this morning. CBS also said its transmissions were stopped.

Authorities in other cities sought to deal locally with similar protests. In Shanghai, about 500 troops moved in early today to try to remove students demonstrating for democracy outside city government offices on the waterfront, Reuters news agency reported.

The troops were ordered into Beijing "to protect the normal functioning of important departments and central organs" because regular police were no longer able to ensure order, President Yang Shangkun said in a speech announcing the order.

During the past week, protests involving hundreds of thousands of ordinary citizens as well as students have demanded the resignations of China's senior leader, Deng Xiaoping, 84, and of Premier Li Peng.

Advocate of Reform

Communist Party General Secretary Zhao Ziyang, China's leading advocate of rapid economic and political reform, reportedly opposed the crackdown ordered today and has offered his resignation, according to Chinese sources who spoke with Western reporters.

It appeared that Zhao has been--and may still be--engaged in a power struggle with other leaders.

Zhao has not been severely criticized by the demonstrators, and some expressed growing support for him this morning. Zhao had sought over the past few days to defuse the student demonstrations by calling them patriotic and linking them to a program of accelerated political reforms that he has long favored.

At least 200,000 people were gathered in Tian An Men Square around noon today in a show of defiance just two hours after mar tial law took effect. Workers who rallied in the square beneath a banner reading "Capital Workers Independent Union" praised Zhao for his stand on the student protesters.

"Before, we didn't know Zhao Ziyang's attitude," one worker said. "Now we know, and we support him."

Premier Li and President Yang announced the military action in speeches aired on radio and television shortly after midnight. The speeches were repeatedly rebroadcast in the early morning hours over government-controlled loudspeakers in Tian An Men Square, where about 100,000 pro-democracy protesters, including students and ordinary citizens, had spent the night.

At the center of the protest was a continuing core of about 2,000 hunger strikers in the square, students who have won widespread public support in a fast now entering its eighth day. A total of more than 3,000 students have taken part in the fast. More than 1,000 have been removed to hospitals, but some of them have returned to the square after treatment, according to medical personnel at the square.

"The capital is in a critical situation," Li said in his speech, made to a large meeting of high-ranking Communist Party and government officials. "A situation of anarchy is getting more and more serious. . . . On behalf of the Communist Party Central Committee and the State Council, I now call on the whole party, the whole army and the whole nation to make concerted efforts and act immediately at all posts so as to stop the turmoil and stabilize the situation."

The speeches of Li and Yang, the order for troops to move into Beijing, and the reaction of students and city residents to these decisions escalated the crisis faced by the government.

There were indications that the sentiment of most students and residents--at least those active in the protests--favored Zhao, who had made extremely conciliatory comments in a televised visit to student hunger strikers in Tian An Men Square on Friday morning.