Judge Severino Santiapichi, the man ultimately responsible for deciding whether there was a "Bulgarian connection" to the 1981 attack on Pope John Paul II, had his hands gripped to his forehead as he sought to make some sense of a morning of wildly contradictory testimony. His courtroom was in an uproar.

Prosecutor Antonio Marini had leaped up from his chair to demand that the pope's would-be assassin reveal the "facts" about his alleged meetings with Bulgarian secret service agents. Defense lawyers were screaming at him to be quiet and let the Turkish terrorist continue his testimony.

Mehmet Ali Agca -- the man at the center of everybody's attention -- was wearing a satisfied smile. Seemingly oblivious to the confusion around him, he addressed the prosecutor directly: "Yes, I understand, you want me to speak about the 'Bulgarian trail.' The moment will come . . . . I cannot speak now."

There were times yesterday, during the most dramatic session yet of the two-week-old papal conspiracy trial, when it seemed as if the pope's assailant was playing with the judges like a cat with a mouse. Tantalizing details about his past career as a terrorist were interlaced with rantings about being "Jesus Christ" and sweeping charges that his life was threatened by the Soviet and Bulgarian secret services.

Throughout the session, Agca refused to give any evidence about three Bulgarian officials whom he has named as his accomplices in the plot to shoot the pope.

The erratic behavior of the 27-year-old Turk has created enormous legal and moral problems for Santiapichi, one of Italy's most respected judges. It means, in effect, that the Italian state's case against the Bulgarian defendants hangs on the pretrial testimony of a self-acknowledged perjurer who is now refusing to cooperate with the court.

Apart from Agca himself, no witness has been found to confirm any of the numerous meetings that are alleged to have taken place both in Italy and in Bulgaria between the Turkish gunman and the three Bulgarian officials on trial in Rome. Nor has there been any trace of the $1.2 million which Agca says he and his Turkish accomplices were paid by Bulgaria to kill the pope.

Among Santiapichi's concerns are the damage that could be done to the reputation of the Italian justice system if the state's case collapses. The three-year investigation into Agca's claims of Soviet Bloc involvement attracted intense media attention around the world and at one point appeared to cast a shadow over the future of East-West relations.

Rumblings of unease about the case surfaced in Italian press commentaries today with a columnist for the respected Turin daily La Stampa describing Agca as "a person without scruples" who was trying to "ridicule the justice system of our country in the eyes of the entire world."

"It is not easy now for our justice system to redirect a trial that has been so polluted and to restore credibility and authority to it. If the possibility of recovery exists, it is not through Agca. The pope's assailant has shown that he cannot lead the judges toward the truth," commented columnist Roberto Martinelli.

In public comments yesterday, Santiapichi referred several times to his responsibility for seeing that the trial was conducted in a proper manner. When Agca announced in stentorian tones that "Bulgaria is guilty," he was admonished by Santiapichi who said, "We are not judging countries, we are judging individual people."

At another point, after spectators in the courtroom burst out laughing at Agca's antics, the judge remarked: "There's not much to laugh about but there is something to cry about."

Under the Italian legal system, a judge has much broader powers than in the United States. In addition to acting as an impartial arbiter, he personally conducts the interrogations of defendants and witnesses and plays a dominant role in the jury's consideration of a verdict.

It is now up to Santiapichi to decide how to deal with Agca when the trial resumes Tuesday. He outlined one possible approach yesterday when he asked the papal assailant if he was prepared to answer questions about three Turkish rightists who are also defendants in the case: Oral Celik, Musa Serdar Celebi and Omer Bagci. In reply, Agca said he would have to consult his defense lawyer.

Complicating the judge's task is the fact that Agca is legally a codefendant and not a witness, a status that allows him to conduct his defense as he wishes and puts him under no obligation to give testimony. Originally convicted in July 1981 of attempting to murder the pope, Agca is now being tried for the lesser charge of smuggling a weapon into Italy.

Italian legal experts believe that the trial could continue even without the cooperation of the pope's would-be assassin with the court interrogating its prepared list of more than 100 witnesses. The case against the Turkish accused is less dependent on Agca's testimony than the case against the Bulgarian defendants since there are independent witnesses to confirm the Turks' relations with Agca.

It is also entirely possible that Agca, whose behavior under interrogation has been unpredictable from the time of his arrest immediately after the attack on the pope, could change tack once again and decide to give evidence against the Bulgarians after all. It would then be up to the court to decide whether his credibility has been jeopardized by the contradictions in his testimony.

Speaking to journalists yesterday, prosecutor Marini insisted that Agca's pretrial testimony against the Bulgarians could be considered part of the court record. He refrained from speculating about the reasons for Agca's latest outbursts although in the past he has raised the suspicion that the pope's would-be assassin could be trying to send signals to accomplices outside the prison.

The court's treatment of Agca was criticized as "extraordinarily tolerant" by a Bulgarian magistrate, Jordan Ormankov, who is an observer at the trial. Ormankov has launched an investigation into Agca's role in spreading alleged slanders against Bulgaria.

Frequently during yesterday's session, Agca glanced around at the rows of defense lawyers and spectators to catch their reaction. He has clearly enjoyed the limelight throughout the trial and occasionally speaks directly to the television cameras rather than to the judges.

Egged on by American television crews to, "say something to us in English, Ali," Agca has responded with a ritual, "I am Jesus Christ," a phrase that he sometimes pronounces beneath his breath in the knowledge that it can earn him a temporary expulsion from the courtroom.

An example of Agca's ability to keep track of events by studying the media surfaced yesterday when the judge asked whether he knew Bagci in the summer of 1980. The apparently innocuous question seemingly was designed to test Bagci's claim earlier in the week that, although he had been in Bulgaria at the same time as Agca, they had not met then.

Agca, who had been formally excluded from the court during Bagci's testimony to prevent any collusion between the two Turks, smiled broadly at the judge's question. When Santiapichi asked him why he was laughing, he replied that he had seen a television report in his cell on Bagci's testimony and that it was simply an "incredible coincidence" that they were both in Bulgaria at the same time.