EAST BERLIN -- Soviet President Mikhail S. Gorbachev told East Germans on Friday that there is "no need for panic," and he urged them to "be patient . . . and don't be sad."

The visiting Soviet president made these impromptu remarks as he greeted crowds at a monument to an unknown soldier, and was obviously referring to the East German refugee crisis. So far this year, more than 100,000 East Germans have fled the country, legally or illegally.

About 1,000 East Germans shouting "Gorby! Gorby!" greeted him at the monument and one asked, "What do we do?"

'We Are Partners'

"Be patient, don't panic and don't be sad," he replied. "We are partners. We must fight to solve our problems together, to fight for socialism."

Gorbachev's off-the-cuff remarks were more pointed and more poignant than the prepared speech he delivered later in the People's Assembly building, where he followed Erich Honecker, the East German leader, to the podium. He was in East Berlin for official ceremonies marking today's 40th anniversary of the Communist state.

He arrived as the government here was closing three key crossing points between East and West Berlin and as new violence erupted over efforts by increasing numbers of East Germans to flee to the West.

Privately, sources reported, Gorbachev has urged Honecker to take a more liberal line, but Honecker has told him, in effect, to mind his own business.

Gorbachev apparently wants to present himself as the apostle of reform--reform that began in the Soviet Union and has spread to Poland and Hungary--but he does not want to provoke the 77-year-old Honecker or encourage anti-government elements here.

Along with his wife, Raisa, Gorbachev was met at the airport and embraced by Honecker, whom he bussed on both cheeks. Their 40-car motorcade into the city was greeted by thousands of flag-waving young people turned out by the Communist Party machine.

After visiting a Soviet memorial to soldiers who fell in World War II, Gorbachev's caravan stopped at the Grecian-style temple on the Unter den Linden dedicated to the "victims of fascism and militarism." Interred there are the bodies of an unknown soldier and an unknown resistance fighter.

'What Are You Doing?'

After a quick look at the interior, Gorbachev emerged and suddenly headed toward the crowd behind a barricade, a crowd that consisted mostly of reporters. One called out in Russian, "What are you doing?"

Gorbachev, apparently calling up a memorized statement, replied:

"My generation is the last generation which, though it did not take part in the war, saw it and knows what it was. We have something to tell today's youth of what sort of people we were then and are now. Not everything happened after the war the way that we wanted in the first days of victory. The memory of those who died makes us responsible for doing now what is needed for peace. We live in one land, have one civilization, and we should do everything in order to live together."

He was asked about his relationship with Honecker, and he replied: "Good. I have known him a long time. We get on fine."

In reply to a question about perestroika , or restructuring, in connection with East Germany, he said: "The important thing is what the citizens of East Germany want. If we in Russia had decided to do our thing the way people outside told us--and not on the basis of our own problems--we wouldn't have got anywhere. What we are doing is extremely difficult. But maybe it is the most significant turning point in our history. It is absolutely necessary. I am convinced of it."

'Our Full Confidence'

Pressed about the East German government's ability to follow the Soviet lead, he said: "We know our German friends very well, and their ability to recognize and to learn from life and to forecast the political road ahead and to introduce corrections where it is necessary. They have our full confidence."