French President Francois Mitterrand, in his first diplomatic event since playing host to Soviet leader Mikhail Gorbachev, visited here today to reaffirm his country's political and military commitment to defend West Berlin.

"I have come to reassure you about the firm will of France to protect the peace and freedom of Berliners," Mitterrand said in a speech at Schoeneberg City Hall.

Noting the "fragile equilibrium" of a western outpost located 110 miles inside East Germany, Mitterrand stressed that the 2,800 French soldiers based here "will remain vigilant and stay by your side to guarantee all freedom of access to Berlin."

As he inscribed his name in the city's golden book of dignitaries, Mitterrand said, "This signature shall serve as a mark of our respect for our responsibilities."

It was Mitterrand's first trip here as leader of one of the four powers that control the former German capital under postwar agreements. The only other French president to visit West Berlin was his predecessor, Valery Giscard d'Estaing, who received a warm welcome when he toured the city in October 1979.

In a notable political gesture to underscore the importance of the French-German relationship within the western alliance, Mitterrand flew here in the company of West German Chancellor Helmut Kohl after picking him up in Bonn. The act provoked a mild protest from the Soviet Union, which contended that Kohl should not be directly involved in the visit by a head of one of the four sovereign powers in Berlin.

The French daily Le Monde, citing the significance of the Mitterrand visit with Kohl aboard his plane, said in an editorial that "such a gesture is not only one of friendship: everything concerning West Berlin carries symbolic value."

At the ceremony in the city hall, Kohl thanked Mitterrand "for your demonstration of friendship, unity and sympathy with us."

Mitterrand acknowledged the wrenching emotional and historical problems caused by the postwar division of Germany and said that France was determined to work for the reconciliation not only of Germans but of all Europeans.

Before embarking on the seven-hour visit, Mitterrand briefed Kohl in Bonn on his discussions last week in Paris with Soviet leader Mikhail Gorbachev, who made his first trip to a western nation since assuming power last March.

Because of France's status as one of Berlin's four occupying powers, Kohl was treated as Mitterrand's guest here even though the western part of the city is fully integrated in the economic and social life of West Germany.

The French president was greeted at the airport by West Berlin's mayor, Eberhard Diepgen, and the local French commander. To avoid controversy over questions of sovereignty, Kohl did not participate in the welcoming ceremonies nor did he join Mitterrand to review a military parade by the French forces.

The two leaders were reunited later in the day to lay flowers at the Bernauer Strasse crossing point adjacent to the Berlin Wall. Many East Berlin residents trying to escape to the West have been killed there by East German border guards.

Five thousand police were mobilized for Mitterrand's visit after West German radicals vowed to disrupt his tour in protest against French sabotage of the Greenpeace protest ship Rainbow Warrior in the South Pacific. But the crowds were sparse, and no clashes occurred.