Reflecting the growing terrorist menace in Spain that has made political violence part of daily life, the Spanish parliament last night overwhelmingly endorsed tough legislation to combat gunmen and their accomplices.

The vote giving police special powers came just hours before Basque separatists early today killed the 105th victim of violence in Spain this year.

Departing from previous left-wing opposition to special-powers legislation, the Socialist and Communist congressmen voted with the government to permit police to interrogate terrorist suspects for up to 10 days after notifying a judge of their detention. The new law, which has to have a final reading from the Senate before taking effect, also gives police powers to enter homes without a court order and to tap telephones and examine mail.

The new legislation replaces provisional laws that have been in effect under special government decree powers and had formerly been criticized by the left on grounds that they were unconstitutional and could lead to abusive police powers reminiscent of the dictatorship of Gen. Francisco Franco. In last night's debate, opposition to the legislation was reduced to only two congressmen in the 350-member chamber -- a radical Basque nationalist and an extremist Marxist independent representing the Canary Islands, Congressman Fernando Sagseta.

Sagaseta charged that the new legislation was "fascist" in its intent.Speaking against this view was a senior Communist congressman, Jordi Sole Tura, himself once a victim of Francoist repression. He said: "Francists are those who from a minority implant their opinions on the rest." The left-wing opposition backing to the bill is expected to make it more palatable to the Spanish public than the present special powers legislation.

The new legislation comes at a time when political violence has reached an all-time record in Spain's recent history. The shooting of bar owner Juan Carlos Ferandez Aspiazu in the Basque town of San Sebastian early today bore the hallmarks of the Marxist Basque independence organization ETA (Basque Homeland and Liberty). Fernandez Aspiazu also worked for the national telephone company, and he was the second company worker to be murdered in the Basque region within a week. The ETA recently warned that the national telephone company should refuse tapping facilities to the police.

ETA have claimed responsibility for the majority of the killings this year which, if the Bologna, Italy, railroad station bomb massacre last August is excluded, put Spain far ahead of any other Western European country in political violence death statistics. In the parliamentary vote the Basque nationalist party duputies abstained, but their spokesman made an unexpectedly strong attack on ETA.