A prosecutor dropped criminal charges of slander against Solidarity leader Lech Walesa on the opening day of his trial here today as the government of Gen. Wojciech Jaruzelski appeared to back down from a confrontation that had divided it internally and threatened its campaign for acceptance abroad.

Prosecutor Raymund Blaszkowski, who had charged Walesa with slandering officials supervising Poland's parliamentary election last October, withdrew his case this afternoon before calling the first witness in a Gdansk provincial court. He said he based his action on Walesa's statement to the court this morning that he had not intended to slander anyone.

Walesa, who faced a sentence of up to two years in prison on the charge, called the move "a sign of hope" and "the first step toward a reasonable agreement" between the government and society.

"Political trials are not in the interest of Poland," he told a press conference. "I am happy that the authorities understood that."

Judge Jerzy Lenarcik accepted the withdrawal of criminal charges but said that the slander case would remain open for two weeks, allowing the election officials to file civil claims if they chose. If no claims were filed, he said, the case would be dismissed.

The dispatch of the criminal case after a day of long delays and only brief formal activity in the courtroom appeared to put an end to a test of Walesa that authorities began four months ago and pressed despite the public disagreement of several high-ranking officials and diplomatic pressure that mounted after a trial date was announced last month.

Diplomatic observers said government authorities had apparently concluded that the cost of prosecuting the outspoken Nobel Peace Prize winner was more than they could afford at a time when Jaruzelski is seeking to restore Poland's ties with western governments. But they added that the fact that the case reached trial before it was called off indicated continuing uncertainty and divisions over how to handle Walesa, who has been investigated several times in the past but never before indicted.

The clearest sign of official opposition to prosecuting Walesa came last week when Mieczyslaw Rakowski, deputy speaker of Poland's parliament and a leading figure in the communist party, called Walesa a man of compromise and said he would not have favored charging him.

Another senior official, government spokesman Jerzy Urban, said he believed that jailing Walesa would not be in the government's interest.

Sources close to Walesa said that private negotiations between Solidarity and government representatives preceded the dropping of charges. While refusing to discuss the bargaining, Walesa described the end of the trial as a "compromise" that could lead to "the agreement we need so much."

"For the first time in many years, a compromise with a member of Solidarity was possible," he said. "What was impossible became reality." Now, he said, "I am convinced that together we can solve many of Poland's problems."

The substance of the case involved three statements Walesa issued during and after parliamentary elections last Oct. 13. Based on reports from a network set up by Solidarity to monitor voting, the statements gave projections of voter turnout, a key issue because of Solidarity's call for a boycott.

In the days after the vote, 15 officials from 10 election committees in six cities, including Gdansk, complained to the Gdansk prosecutor that Walesa had slandered them by offering different figures of the turnout than those the committees had officially reported. Most of the projections reported by Walesa showed a lower turnout than was officially announced, but in two cases, his projection was higher.

Authorities, who sought to portray the official national turnout of 78 percent as a success, were irritated by the reports of Walesa and the Solidarity network, that said that it had calculated the national turnout at closer to 60 percent. The charges against Walesa, widely publicized by the state-controlled media, were regarded by most observers as a propaganda initiative.

In December, however, the prosecutor filed charges against Walesa, and two weeks ago a trial date was announced. In what was taken as an indication of uncertainty, Urban summoned western reporters to say that if Walesa announced that he had not intended to slander the officials, they might be willing to drop charges. But even after Walesa made the statement in interviews, the charges were not withdrawn.

Even today's settlement gave indications of official wavering. In the opening session, the prosecutor said that a statement by Walesa might resolve the case, and Walesa responded by saying that "it was not my intention to slander anyone, nor did I intend to demean anyone," according to western reporters admitted to the proceedings.

After a recess to consider Walesa's statement, the prosecutor returned to the court and asked if Walesa's remark was intended "to give satisfaction to those who were injured." Walesa responded by repeating his earlier statement, and another recess was called. Only after the court reconvened this afternoon did the prosecutor drop charges.