Rebels and Government forces fought a fierce battle in this capital today, heightening fears that they would revive their all-out civil war. The state radio said many people had been killed.

Machine-gun fire and explosions echoed through Luanda, and a Portuguese radio report said several rebel soldiers lay dead in front of a hotel in central Luanda that they use as a base.

Edmund De Jarnette, the head of the United States liaison office in Luanda, said the fighting started shortly after the two sides halted a round of negotiations seeking a political solution to their standoff over election results and other issues.

“There is substantial fire in several areas,” he said by telephone.

Tension has been mounting in Angola since the National Union for the Total Independence of Angola, which is led by former rebels, lost national elections on Sept. 29 and 30. to the governing Popular Movement for the Liberation of Angola. The opposition leader, Jonas Savimbi, accused the Government of rigging the vote and threatened to fight rather than accept the election defeat.

The United Nations, which brokered the May 1991 peace accords that paved the way for the elections, says the balloting generally was free and fair.

Angola’s 16-year civil war began almost immediately after it gained independence from Portugal in 1975. Cuba and the Soviet Union armed the Government, and the United States and South Africa backed the rebels.

The heaviest shooting today appeared to be around the Hotel Turismo, which is used as a base by the rebel group, known as Unita for its acronym in Portuguese. The Portuguese radio station T.S.F. reported that the hotel and a nearby police station were in flames.

Witnesses said machine guns, mortars, rocket-propelled grenades and heavier weapons were being used. They said mortar shells fired from the Miramar district, where the rebels have a garrison, were falling onto the city center and into Luanda Bay. Roadblocks Set Up

Hours earlier, the state radio broadcast appeals for people to stay home and keep children off the streets. Heavily armed police officers patrolled the city and set up roadblocks.

Fighting was reported to have claimed dozens of lives on Thursday and Friday in Luanda and in Huambo, which is Angola’s second-largest city and the rebels’ stronghold.

News reports in Lisbon said the Portuguese Government had sent frigate carrying 200 marines to the West African coast to prepare a possible evacuation of the some 40,000 Portuguese citizens in Angola.

The British Government told its nationals on Friday to leave Angola, and other countries have evacuated nonessential staff from their embassies.

The United Nations Security Council demanded an end to the clashes on Friday night and said any government imposed by force would not be recognized. Western diplomats said economic sanctions would be imposed if the rebels seized the Government.

[ Secretary General Boutros Boutros-Ghali issued a statement appealing to President Jose Eduardo dos Santos and Mr. Savimbi “to withdraw immediately their forces and to return them to the barracks.” He also urged a resumption of the talks. ]

The governing party of Mr. dos Santos began moving away from Communism as the cold war came to an end in the late 1980’s. In April 1990 the Government opened peace talks with the rebels.

The Cubans began pulling out in January 1989, and South Africa agreed to stop aiding the rebels.

After years of rivalry over the oil- and mineral-rich nation, the Soviet Union and United States joined with Portugal in mediating the talks that led to the peace accords signed by Mr. dos Santos and Mr. Savimbi in May 1991. rule ——————– U.S. ORDERS DEPARTURES

WASHINGTON, Oct. 31 (Special to The New York Times) — The State Department ordered all its nonessential employees to leave Angola today because of the fighting there.

The department also urged American citizens to avoid traveling to Angola and advised those who were already there to leave as soon as possible.

The department said slightly fewer than 300 Americans were in Angola at the end of last month, when the country held its elections. It said it did not know how many Americans had since left, and it declined to say how many department employees were there.