Poland today expelled two U.S. diplomats who had been accused of leading supporters of the outlawed Solidarity trade union in a May Day demonstration near Krakow.

The United States responded immediately by announcing the expulsion of four Polish diplomats, one from the embassy in Washington and three from the Polish Consulate in Chicago. A State Department statement assailed the "unwarranted Polish action" and the "outrageously false accusations" employed "as the pretext to expel our officers from Poland."

The day's mutual expulsions and the accompanying recriminations, coming after the expulsion Feb. 24 of a U.S. military attache accused of spying, were expected to end for the time being any prospect of improvement in relations between Poland and the United States.

Ties have been badly strained since the suppression of Solidarity in December 1981, but in recent days there had been signs of a slight easing. A U.S. trade delegation this week had made its first visit to Poland since the Solidarity period, flying to Warsaw on the first direct Pan Am flight from the United States after the conclusion last month of a new U.S.-Polish air agreement.

Some Polish officials had been encouraged by the recent thaw in U.S.-Soviet ties to foresee improved U.S.-Polish ties. But the refusal of the United States to lift remaining curbs on financial credits and trade tariffs and the continuation of Polish-language broadcasts critical of the government in Warsaw by Radio Free Europe and the Voice of America are a persistent source of deep irritation to the communist authorities here.

Meanwhile, in another development, riot police were deployed in Warsaw this evening and broke up a crowd of several thousand people chanting Solidarity slogans as they emerged from a Roman Catholic mass in the capital's Old Town district.

The protest represented what has become an annual show of defiance on May 3, the anniversary of Poland's first democratic constitution. The charter was passed in 1791 but not implemented before the final partition of the country by Russia, Prussia and Austria.

The expulsion of the U.S. diplomats followed a public denunciation yesterday of their alleged involvement in a march in the industrial district of Nowa Huta. The U.S. Embassy here strongly rejected the charge, insisting the diplomats merely had been observing the protest, and lodged a counterclaim that one of the diplomats had been kicked and shoved by police into a van.

A government statement denounced the lack of any expression of regret or apology from the Reagan administration over the conduct of the two diplomats and said the U.S. response had contained "inadmissible slanders and threats addressed to the government . . . ."

As a result, the statement said, it was "forced" to expel the two diplomats -- William Harwood, a first secretary, and David Hopper, a consul. The two men, both based in Krakow, were given seven days to leave.

The State Department statement announcing the expulsion, in the same period, of the four Polish diplomats -- Boguslaw Maciborski, a first secretary at the Polish Embassy in Washington, and Romuald Derylo, Jozef Kaminski and Stanislaw Zawadzki, all with the Polish Consulate in Chicago -- said:

"The United States has taken this action in response to the unacceptable treatment in contravention of the Vienna Convention on diplomatic relations as well as the U.S.-Polish consular convention of two American diplomats in Krakow on May 1 and the outrageously false accusations that the Polish government has used as the pretext to expel our officers from Poland.

["This incident, like the gross mistreatment of our defense attache and his wife in February, indicates that the Polish government is either unable or unwilling to require its internal security apparatus to observe the norms of civilized behavior." ]State Department spokesman Ed Djerejian said in reply to questions that four Poles rather than two were being expelled because "we want to express our grave displeasure not only with the unjustified expulsion of our diplomats but also with the Polish government's bald fabrication of a story to justify their expulsion. Our personnel were observing May Day events, a normal diplomatic function, when they were roughed up and illegally detained by Polish security police . . .

["Rather than apologize as the actual facts of the matter require, the Polish government has chosen to adopt the internal security apparatus' false account of the incident in . . . a crude attempt to damage further the bilateral relations between the United States and Poland."]

"We are baffled," said a U.S. Embassy spokesman about today's expulsions. "This is based on totally ludicrous grounds."

Polish authorities maintain Harwood and Hopper were among 15 leading demonstrators detained in Nowa Huta on May 1 while shouting antigovernment slogans and waving Solidarity banners. The government condemned the alleged involvement of the two as a "flagrant violation" of their diplomatic status and as an "unacceptable interference in Poland's internal affairs."

The diplomats were released with apologies after 20 minutes at a police station where their diplomatic credentials were checked.

Today's government statement said the actions of the diplomats, together with that of the military attache expelled earlier, "confirms that in its attitude toward Poland, the U.S. government does not intend to depart from the policy of political pressure, threats, economic restrictions, interference in Poland's internal affairs and the hampering of the processes of stabilizing the situation."

On another diplomatic front, an attempt by Poland to revive relations with Western Europe has faltered on the insistence of West European officials of contact during official visits with members of the political opposition.