WARSAW -- Security forces armed with automatic weapons fired into crowds of protesters in the Romanian capital of Bucharest on Thursday, killing or wounding an undetermined number of demonstrators demanding an end to the rule of dictator Nicolae Ceausescu.

A reporter for Tanjug, the Yugoslav news agency, said several thousand demonstrators, mainly schoolchildren and university students, were surrounded by police and tanks at a main intersection near the Inter-Continental Hotel in the center of Bucharest. Peter Tomic, a Yugoslav journalist, said he saw an armored vehicle crush two students. When others rushed to their aid, security forces opened fire, killing or wounding about 20 people.

In Washington, the State Department quoted U. S. Embassy officials in Bucharest as saying that at least 13 young people had been killed in the demonstration just two blocks from the embassy. Budapest Radio reported 32 more demonstrators were killed in the northern city of Cluj.

The Soviet news agency Tass reported at midnight that the sounds of gunfire from automatic weapons could still be heard echoing in the center of the capital.

"There is light in all the windows of buildings in the areas where the demonstrations are under way. People have come out onto balconies and some of them are shouting slogans supporting the protests," the report added.

Reports on the second assault on unarmed civilians in five days came mostly from such East Bloc news organizations, among the few foreign news services reporting from Romania, which has been sealed off to foreigners since Monday, as the Ceausescu regime faced what could be its terminal crisis after 24 years in power.

Gunfire was also reported to have broken out at a demonstration in the city of Arad in western Romania, about 40 miles from the western city of Timisoara, where security forces opened fire on demonstrators Sunday. Estimates of the death toll in Timisoara range from a few hundred to as high as 4,000, but there has been no independent confirmation of the casualties. Even East Bloc journalists, attempting to reach Timisoara, have been turned back from the town.

The Tanjug correspondent, reporting on Belgrade Radio, said the confrontation in Bucharest had turned into a "bloody riot."

Before its midnight report, Tass said, "Along the central street of the capital, tanks are moving, following the lines of submachine gunners pushing back the crowds. Bursts of automatic weapons fire are being heard. Panic-stricken people are hiding in doorways and courtyards."

Tass added that "a great many fire brigade trucks and military trucks with personnel are being concentrated in the central part of the Romanian capital," and approaches to Communist Party headquarters and Ceausescu's presidential palace were blocked by heavily armed army units.

Tass reported that students had gathered late into the night on the grounds of the university and had called for a general strike today. It said the students claimed to have sent representatives to factories to urge workers to join the strike. It added that anti-government leaflets have appeared on walls in the city.

Ceausescu, 71, whose disregard of human rights has ranked him among the most notorious dictators on the globe, told Romanians in a speech Wednesday night that the demonstrations in Timisoara were inspired by "fascists" and "international espionage centers."

He issued no warnings about further action against demonstrations, but defended the actions of security forces in Timisoara.

With the country so effectively sealed off, accounts of the Timisoara events have come only at a trickle and are of uncertain reliability. But some of them begin to suggest that Ceausescu may be facing a problem in keeping army and police units loyal to his cause.

A Yugoslav newspaper reported that a truck driver, returning to Yugoslavia from Timisoara, said security officers publicly executed soldiers who refused to shoot at the demonstrators. He did not say when the executions took place, or how many people were involved.

Two other sources reported that the demonstrators in Timisoara managed to take control of at least two tanks during the protests. A woman resident of Timisoara, whose taped interview was broadcast on Hungarian television Wednesday night, said protesters seized at least five tanks. Armored units then opened fire on the captured tanks, she said.

According to one Austrian physician, who was visiting relatives in the western city and who spoke with the Romanian section of Radio Free Europe, the demonstrations started last Saturday when protesters broke shop windows, looted stores, attacked the local government center and burned books written by Ceausescu.

The demonstrations continued Sunday, when large forces of heavily armed security troops arrived with tanks and armored personnel carriers. Throughout the day, the tension mounted steadily, until about 8 p.m., when, the witness said, he found himself among ranks of demonstrators confronting the security forces. His account goes on:

"Suddenly, machine guns and shotguns started rattling. In a few seconds, 30-40 people fell in front of me, wounded or dead. . . .