The explosion today of a powerful bomb that killed two persons added a dramatic new twist to the battle of Gaston Defferre, the interior minister in France's socialist government, to ward off opposition attempts to deprive him of his power base in Marseilles.

The contest for Marseilles, the second largest city in France and a socialist stronghold for the past 30 years, has heated up since the first round of the municipal elections last Sunday indicated that Defferre was in serious danger of being beaten. Both Defferre and his right-wing opponents are attempting to use the emotional issues of security and immigration to their own advantage in the final runoff next Sunday.

Today's bomb exploded near the Jewish synagogue in Marseilles--and there was immediate speculation that it was the bomb's target. The two men who were killed had been seen driving past the synagogue shortly before the blast and police were working on the assumption that they were preparing an attack on the building.

The issue is a highly political one because both Defferre and his principal opponent, Jean-Claude Gaudin, have been trying to win the support of the 80,000 Jewish voters of Marseilles. Traditionally, they have sided with Defferre but this time many are believed to have supported the right because of concern about his new-found alliance with the communists.

Detailed results from Sunday's elections showed that Defferre, who used to win elections in Marseilles by presenting himself as "the bastion against communism," got squeezed from both ends. He lost much of his traditional middle-class support and was unable to convince enough of the usually highly disciplined communist voters to go to the polls.

His fate next Sunday thus depends on whether he can rekindle old allegiances among such sections as the Jewish voters while at the same time persuading the communists to vote for a man they once regarded as their sworn enemy.

Speaking at the scene of today's explosion, Defferre poured scorn on the opposition leaders for hinting that several previous bomb attempts in Marseilles during the election campaign might have been inspired by his own supporters. He also took the opportunity of "declaring my respect for those who could have been the victims of these bombs" and affirming his "attachment to the Jewish community."

As interior minister, Defferre is held directly responsible by the right for a worrying rise in the crime rate in Marseilles. The first round of the elections left a group calling itself "Marseilles-security" holding the balance between the political parties.