DAMASCUS, Syria (AP) _ Syria on Friday ordered three West German diplomats and an unspecified number of West German military attaches to leave the country, one day after Bonn accused Syria of aiding a bomb attack and ordered the expulsion of five Syrian diplomats.

Syria also said it was withdrawing its ambassador from Bonn until further notice. President Hafez Assad's government has denied involvement in international terrorism.

The reciprocal moves came five weeks after Britain cut diplomatic ties with Damascus, also citing Syrian involvement in a terrorist attack.

The state-run Syrian Arab News Agency said the Foreign Ministry summoned West German charge d'affaires Willibald Dilger on Friday morning to inform him the three diplomats had a week to leave the country.

It said the number of West Germany's military attaches will be reduced until it equals to the number of Syrian military attaches in Bonn. Two of the five Syrian diplomats ordered to leave Bonn were military attaches, leaving just two Syrian military attaches in West Germany.

It was not immediately known how many German military attaches will have to leave Damascus.

The Syrian news agency said the government expressed regret that West Germany was ''bowing to the pressures of the United States and the United Kingdom and joining the campaign of lies and defamation against Syria and taking unjustified action which is not based on any evidence.''

In Bonn, a spokesman for the West German Foreign Ministry, Hans Gnodtke, said Syria's move was ''regrettable and inappropriate.'' He spopkesman declined further comment.

A West Berlin court on Wednesday convicted two Palestinians of bombing the German-Arab Friendship Society in the city on March 29, wounding nine people. In pre-trial statements, the Palestinians said they got the explosives from the Syrian Embassy in East Berlin. They identified their contact as a senior officer in Syria's air force intelligence service.

West Germany announced Thursday that it was giving three Syrian diplomats and two Syrian military attaches a week to leave the country and was freezing $28 million in development aid to Syria.

Bonn also said it would not replace its ambassador to Syria, Heribert Woeckel, who ended his tour of duty earlier this month, and would no longer allow Syrian officials who do not have diplomatic status to enter the country on special ''service passports.''

In response to the last measure, Syria said it no longer would accept official diplomatic passports issued by the Bonn government. The implications of the move were not immediately clear.

The Foreign Ministry told Dilger it was forced to take the retaliatory measures even though Syria ''is very keen on developing relations between the two countries,'' the Syrian news agency reported.

The Western Allies who govern West Berlin on Thursday backed West Germany's actions by announcing that certain unidentified Syrians would not be allowed to enter the western sector of the city.

Berlin has been divided into four zones of occupation since World War II. The U.S. British and French zones make up West Berlin, which is separated by a wall from East Berlin, which is the Soviet occupation zone and capital of Communist East Germany.

The United States and Common Market countries imposed limited sanctions against Syria last month after Britain severed relations with Damascus. London said it had evidence that Syria backed an attempt to smuggle a bomb aboard an Israeli airliner at Heathrow Airport last April.