BERLIN (AP) _ Egon Krenz warned East Germans on Tuesday to stop street demonstrations, but up to 12,000 marched in East Berlin after dark to protest his election as president. Police directed traffic out of their way.

The ritual election by the customarily docile parliament was made dramatic when some members voted ''no'' for the first time.

In a speech afterward, Krenz said continuing weeks of pro-democracy protest could cause a ''worsening of the situation, or confrontation.''

At nightfall, lines of East Berliners carrying candles marched through the central district, chanting ''Egon, who sked us?'' - a recurring phrase since Krenz became Communist Party chief last week - and ''We are the competition 3/8''

Police did not interfere, and kept the route clear of traffic.

ADN, the official news agency, reported the protest without criticism. ''Several thousand people, mostly youths'' carried banners and chanted slogans denouncing the election and ''demanding changes in the election laws, more democracy and an open press,'' it said.

It estimated the number of marchers in the two-hour protest as ''as high as 12,000 at times.''

On Monday in Leipzig, more than 300,000 people marched in the largest protest of the nation's 40-year history.

After his election, Krenz reaffirmed East Germany's allegiance to Communist orthodoxy, despite the reform sweeping through the Soviet bloc. He also promised to investigate charges of police brutality against pro-democracy demonstrators earlier this month.

The new leader, who succeeded Erich Honecker as Communist party chief and president, was in charge of police at the time.

Officials admitted for the first time Tuesday that police attacked peaceful protesters. In a report carried by the official news agency, the government said: ''There were instances where security officials exceeded their authority and illegal acts were committed against some of those detained.''

ADN said officials decided police should use restraint ''unless there is violence or the threat of violence,'' and had prohibited the use of firearms.

It said police commanders had apologized to victims of verifiable brutality. ADN said 83 complaints were under review and prosecutors had taken up four cases, according to the report prepared by the parliament committees on national defense and justice affairs.

Krenz said in his speech, ''Proper steps will be taken if the evidence warrants them. Anyone who was treated unjustly has the right to take advantage of their legal rights.''

Twenty-six members of the 500-seat People's Chamber voted against Krenz for president, although he was the only candidate, and 26 abstained, ADN reported.

It was the first time members of the Communist-controlled chamber had voted against the sole candidate for president.

After his election, the 52-year-old leader declared to the legislators:

''Demonstrations, however peacefully they may be planned and thought out, carry within themselves the danger of ending in a different way from how they started.

''That is unsettling to many people, and rightly so. Our society, which has so many new things to tackle, is thus put under increasing tension.''

In Bonn, West Germany, Chancellor Helmut Kohl said Tuesday he was prepared to meet with East Germany's new leader to advance inter-German relations.

''If it is seen as useful by both sides ... from my side there are no difficulties in the way of a well-prepared meeting taking place,'' Kohl told reporters in Bonn.

East Berlin's official news agency swiftly reported the summit offer.

Krenz and his colleagues have said they will exclude the growing opposition from talks about change in a system whose rigidity has caused tens of thousands of East Germans to flee and hundreds of thousands to protest. The Communist leadership says there already are enough officially recognized groups in which to discuss necessary changes.

''Renewal of society requires the strong socialist foundation, which was put in place in a joint effort,'' Krenz said.

Opposition groups have released written statements from witnesses and victims describing brutal treatment by police during protests and while people were in custody.

Many victims said they were forced to stand naked for hours in frigid holding cells.

Others reported being beaten and humiliated by officers after street protests Oct. 7-8 in East Berlin. Police used clubs to disperse the demonstrators and arrested hundreds.

On Tuesday, Krenz said he would seek ''new impulses'' for possible change from President Mikhail S. Gorbachev of the Soviet Union, who champions reform, during a forthcoming visit to Moscow.

Representatives of several hundred workers at the Wilhelm Pieck electronics factory said in a statement Monday they had organized an independent labor union called Reform that demands the right to strike, and to set wages and prices at the factory.

On Tuesday, ADN denied such a union had been formed.

Party leaders are expected to oppose independent unions that could gain widespread support and challenge the Communist monopoly on power, as occurred with Solidarity in neighboring Poland.