The Maryland Court of Appeals ruled yesterday that a confession obtained from a suspect while he is awaiting his first hearing may not be admitted in evidence if there was an "unnecessary delay" in taking him before the magistrate.

The judges, in the 4-to-3 decision, ordered a new trial for Wade Johnson, who was convicted in 1976 of shooting an Annapolis cleaning store clerk during a robbery.

Assistant Attorney General Stephen Caplis, who had argued the state's case, said the ruling may make it more difficult for police to obtain confessions from suspects.

In a strongly-worded dissent, Chief Judge Robert C. Murphy said that the majority "not only adopted a position concededly at variance with the over-whelming weight of authority in the country but had overruled long-established and well-considered Maryland law to the contrary."

Johnson, who is serving a 35-year sentence in the Maryland House of Correction in Hagerstown, had challenged the use of a confession at his 1976 trial Caroll County Circut Court.

Johnson had trial turned himself in to police at 3:15 p.m. on Jan. 30, 1975, after a warrant had been issued for his arrest in connection with another robbery.

He was informed orally that he was under arrest "for investigation" of that robbery, which involved a supermarket, and his rights were read to him. Police did not attempt to take him to a magistrate for a initial appearance, as required by Maryland law at that point in arrest procedure.

Johnson, who complained of stomach ache and asked for permission to rest, was placed in a cell until the morning of Jan. 31, according to the court opinion.

Police then interrogated him for six hours, that culminated in his confession to complicity in the supermarket robbery. The statement was signed at 3:45 p.m. on Jan. 31 - more than 24 hours after Johnson was taken into custody.

Only then was he taken for his first appearance before a magistrate.

The judges noted that "it is undisputed" that a magistrate had been "available at all time and that his office was but a short distance from the station house."

After returning from his appearance before the magistrate, Johnson was questioned once again and confessed to the cleaning store shooting.

In a pretrial hearing in 1975, his lawyer sought to have that confession supressed.

The judge denied that request, and Johnson was convicted in January 1976 for the cleaning store robbery and shooting.

The Maryland Court of Special Appeals had upheld that conviction.

In the Court of Appeals hearing, the had urged that the Maryland rule requring a suspect's immediately appearance before a magistrate was not mandatory as long as the suspect was read his rights and the confession was not obtained improperly, Caplis said.