A 30-year-old Maryland prisoner obtained incriminating evidence from two of the area's most celebrated murder suspects -- each held in a different jail -- during a period of less than five weeks last summer.

John B. Anderson, who was serving a four-year sentence in a Maryland state prison in Hagerstown, for house-breaking, was shuttled to Prince George's County, then to Montgomery County last July after he filed a circuit court appeal.

Anderson now claims that police recruited him to obtain incriminating evidence from the two suspects in the Montgomery and Prince George's detention centers, and that police promised to help him obtain parole as a reward. The lawyers for the suspects charge that Anderson was improperly planted with their clients as a police informer.

The first suspect, Charles M. Wantland, is accused of murdering a 12-year-old Clinton boy last June 19. Wantland was isolated in the Prince George's County detention center in Upper Marlboro and did not have a cellmate until Anderson was placed with him on July 12.

The second suspect is Paul E. Wersick, who is accused in the shooting death of a Montgomery County tax assessor last July 11. Anderson was transported to the Montgomery County Detention Center in Rockville and placed in a holding cell near Wersick two days after Wersick's arrest on July 15.

In all, Anderson was held in Montgomery and Prince George's jails for more than a month because Prince George's authorities said they were deciding whether to prosecute him on a two-year-old pending charge. Eventually, the charge was dropped.

Prince George's law enforcement authorities, who have named Anderson as a possible witness in the case against Wantland, said last week that Anderson volunteered evidence about Wantland and was not planted by the police. Montgomery County police have refused to comment on Anderson or his involvement with Wersick's case.

Defense attorneys for Wantland and Wersick argue that if Anderson was deliberately planted by the police, then evidence obtained by him cannot be used in court against their clients.

Both cite a 1964 U.S. Supreme Court ruling that held that a defendant's constitutional rights were violated when prosecutors used as evidence incriminating statements the defendant made to a codefendant who was working with government authorities.

Wersick's attorney, J. James McKenna, has asked the Montgomery County Circuit Court to throw out any evidence obtained through the use of "jailhouse police agents," according to papers filed last week.

Joseph Niland, Wantland's attorney, said he has met with Prince George's prosecutors and he said he would file a similar motion if Anderson is called as a witness against Wantland.

Anderson first charged police with using him as a plant in the two cases during a tape-recorded interview with McKenna late last December. The interview took place two days after Anderson wrote to McKenna, asking to see him on an "urgent" matter. Anderson's charges have been summarized in court papers filed by McKenna, and a partial transcript of McKenna's interview with Anderson has been obtained by The Washington Post.

In his letter to McKenna, Anderson said, "I am a police informer and I am a very good one, but there are certain things that I do not do or agree with... I disapprove of the tactics that were used on [Wersick] by various law enforcement agencies."

According to McKenna's court motion, Anderson alleged that after obtaining incriminating evidence from Wantland in Prince George's he was "deliberately and knowingly transferred from the Prince George's County Detention Center to the Montgomery County Detention Center as a police 'plant' for the sole purpose of working for the police to extract any information possible from Paul Wersick."

In the early morning hours of Aug. 19, Anderson was taken from his cell by Montgomery County police, according to jail authorities. Anderson went with them to Wersick's Wheaton apartment building, where police say that they found a revolver, allegedly stolen during a burglary, according to testimony during a hearing in the Wersick case.

Police officers testified at the hearing that although Anderson went with them the night the gun was found, Anderson's information merely corroborated other incriminating statements obtained from Wersick at the detention center by another prisoner.

In his motion, McKenna charges that Anderson in fact extracted most, if not all of the allegedly incriminating statements made by Wersick, and that the other inmate in the detention center merely told police what he had heard from Anderson.

According to Prince George's court records, Anderson was transferred to Prince George's on July 12 after he filed a petition in Circuit Court requesting that he be transferred to the Prince George's jail. Anderson claimed in the petition that he had been harassed by prisoners at Hagerstown and had been put in an isolation cell for his own protection.

When Anderson arrived in Prince George's, however, authorities informed him that the Circuit Court did not have jurisdiction to hear his plea, according to a public defender appointed to represent Anderson, Jess Schiffmann.

Schiffmann said that he asked that Anderson be kept in Prince George's anyway, to clear up a March 1976 charge of breaking and entering that Schiffmann said still was pending and had delayed Anderson's parole. A judge ordered that Anderson be held in the detention center until prosecutors decided whether to proceed on the charge or drop it. Eventually the charge was dropped.

"I accomplished my purpose," Schiffmann said. "My client wanted to get transferred to Prince George's and my goal was to accomplish that. That was done by getting him held on the old charge."

Jail officials say they put Anderson in a cell with Wantland for security reasons. After three days with Wantland, Anderson was transferred to the women's section of the detention center for his own protection, according to court records.

Then, on July 17, Prince George's prosecutor Joseph C. Sauerwine obtained a court order to have Anderson transferred to the Montgomery Detention Center. Again, the rationale given was Anderson's personal safety. At that time, prosecutors said they had still not decided whether to prosecute Anderson on the old breaking and entering charge.

Anderson stayed in the Montgomery detention center for more than a month, jail officials said. Jail officials said that after lerning around Aug. 19 that Anderson "was cooperating" with police in the Wersick case, Anderson was moved from Wersick's area of the jail because officials believed it was dangerous for him to remain there.

Anderson's name first came up in the Wersick case during police testimony at a hearing last October in which defense attorney McKenna sought to have Wersick's case transferred to the juvenile court. After the hearing, the judge ruled that Wersick should be tried as an adult.

McKenna is seeking a rehearing based on Anderson's allegations about his role in the case. A hearing on his request is scheduled for Feb. 22.

Wantland's case is scheduled for trial March 12.

Anderson now is back at the Hagerstown institution, and has written to the U.S. District Court in Baltimore asking for protection by federal authorities, according to Hagerstown prison superintendent Gerald Keller.

His request has been denied by a U.S. judge, according to Keller, after the judge determined that the state institution was taking adequate steps to protect Anderson.