The Spanish Supreme Court threw a readblock at Spain's march toward democracy today by rejecting a government order for a ruling on the legality of the Communist Party, outlawed since the end of the civil war 48 years ago.

The court's unexpected ruling, reportedly handed to government lawyers this afternoon, was a severe political blow to Premier Adolfo Suarez, who was told by the court that it is up to the government to make a decision on whether the party is illegal.

Lawyers for the party were told details of the verdict but were told they will not receive the text until Saturday.

Until three days ago government officials and Communist leaders had been almost certain that the court would lift the long ban on the party, making it possible for Communists to participate legally in Spain's budding democracy.

A party spokesman said the ruling was a victory for the Francoist judges on the court and for the rightist faction of the establishment because it "impedes the advent of a real democracy in Spain." He added that the court had also thwarted the premier and King Juan Carlos, Franco's democratic minded successor, who had "hoped for a fair ruling." The party's general secretary has praised the premier for his efforts to establish democratic procedures in Spain.

Suarez must now decide how to proceed with an angry and frustrated Communist Party, probably the country's best organized political machine. A party spokesman said; "They are toying with us. We won't take this kind of runaround."

Suarez shifted the responsibility for legalizing the party to the Supreme Court last month. The court, according to lawyers familiar with the ruling, declared that in its opinion that the "registration of a political party is an administrative and not a judicial matter."

By sending the case back to the government, the court left Suarez with little room to maneuver in what is probably the most explosive political issue in Spain since the death of Generalissimo Francisco Franco in 1975.

Many Spaniards consider the party responsible for atrocities during the civil war and do not trust it. Others insist that there can be no democracy in Spain without Communist participation.

The premier can alienate the right and the centerright, which is adamantly anti-communist, by using the administration's power to make the party legal. If he retains te ban, he can lose the support of the left, which has cooperated with his efforts to create a viable democracy so long as it seemed that the party could become legal.

Suarez has another alternative. He can ask Juan Carlos to appoint a royal commission to rule on the Communists and several parties to its left whose cases are still before the Supreme Court.

Whatever course Suarez takes will requirt time and will probably upset the delicate balance of Spanish political forces, which are campaigning for this spring's parliamentary elections. The Communist Party, which has been operating openly for months, has announced candidates for the first free voting in Spain since the 1936-39 civil war.

Indications that the government was going to have trouble with the Supreme court emerged earlier this week after the death of the chief justice of the special chamber that was considering the Communist case. The full court rejected the government's nomination of a liberal from another chamber to preside over final deliberations. At the time, the judges reportedly were in a 5-5 deadlock on the Communist case.

According to Communist Party lawyers, the rejection of the liberal nominee, who had been expected to break the tie, and the sudden illness of judges favoring legalization, paved the way for today's decision.

The court's vote against the judge chosen by the government was interpreted here as a slap at Suarez. It was the first time in 48 years that the court had rejected a government appointment to head a chamber.