BONN, West Germany (AP) _ The Red Army Faction, West Germany's most notorious leftist terrorist gang, claimed responsibility for a shotgun attack on a senior government official, authorities said today.

In a letter to a news agency in Bonn, the group said one of its ''commando squads'' attacked Hans Tietmeyer, one of Chancellor Helmut Kohl's key advisers, on Tuesday for involvement in what the group called ''imperialistic'' finance policies.

Tietmeyer was not injured when his car was fired on near his home in the Bonn suburb of Bad Godesberg. Officials said the attack was apparently aimed at disrupting international finance talks that begin this week in West Berlin.

Government sources, speaking on the condition of anonymity, said there were indications the attackers planned to kidnap Tietmeyer.

Hans-Juergen Foerster, spokesman for the Federal Prosecutor's office, said the letter claiming responsibliity was signed by a Red Army Faction commando squad calling itself ''Khaled Aker.'' He said it could not be immediately determined what that name symbolizes.

The Red Army statement said Tietmeyer was ''responsible for murder and massive misery in the Third World'' because of his involvement in international policies governing financial assistance for poor nations.

Foester also said investigators have determined the pump-action shotgun used in the attack was stolen by the Red Army Faction in a 1984 gunshop robbery. He said the weapon was found by federal investigators near the area where Tietmeyer's car was fired upon Tuesday morning.

''A loaded magazine for a machine pistol was found in the same area,'' Foerster said.

Tietmeyer is a state secretary in the West German Finance Ministry and advises Kohl on international finance.

Foerster said the attack appeared to be connected to the World Bank- Internati onal Monetary Fund conference in West Berlin, which begins with preliminary talks Thursday.

Security officials say the Red Army Faction has about 20 members and several hundred sympathizers. It has been responsible for a series of arson, bombing and assassination attacks against government, industrial and military targets since its formation in the early 1970s.

The Red Army Faction claimed responsibility for the 1986 murder in Bonn of West German diplomat Gerold von Braunhuehl.

The 57-year-old Tietmeyer has been involved in planning for the World Bank- IMF meeting. He is also deputy governor for the IMF in West Germany.

Up to 40,000 leftist protesters are expected in West Berlin during the Sept. 27-29 talks to demand better treatment by the world's industrial nations of poorer, heavily indebted countries.

West German security officials have warned that militant protesters could cause trouble during the talks.

Heavy security has been put into place in West Berlin for the financial discussions and several people have already been placed in ''preventive detention,'' said a police spokesman. He refused to say how many people had been detained and declined to identify them.