Two special Baltimore police squads, responding to reports of a prisoner riot, a barricaded gunman, and a wounded jail trusty, mounted an elaborate assault on the city courthouse yesterday and found only an empty basement.

After firing four rounds of tear gas into the basement, the teams charged into a tunnel between the courthouse cellblock and a side entrance on East Lexington Street to find 12 trampled corned beef sandwiches and a coagulating pool of blood. These were the only remnants of a scuffle that had ended almost an hour earlier.

Apparently, at the same time the two squads stormed the building the barricaded gunman they were seeking already had been transported back to the city jail with a group of eight other prisoners who had been at the courthouse for legal proceedings.

Police said it may be several weeks, if ever, before they figure out what happened in the courthouse basement yesterday afternoon.

A few facts are certain. Shortly before 4 p.m. Trusty James C. Williams and guard Walter Lucas collected nine prisoners for trip down three stairways between the courthouse cellblock and the side entrance.Police vans were waiting there to move the group to the city jail.

Police said the prisoners were handcuffed. They said, however, that one of the prisoners apparently managed to shoot Williams once, and in the ensuing struggle Lucas was beaten over the head with his own pistol, a .38 caliber revolver.

Both Williams, 33, and Lucas, 33, were reported in guarded condition at Baltimore's Mercy Hospital. Officials said Williams had suffered a single wound in the upper right leg and Lucts had back and neck injuries.

City police at the court quelled the mini-riot immediately, police said, hustled the prisoners into the vans, and rushed them to the ail.

They worked so quickly, apparently, that they failed to notice that the gunman was among the group taken to jail.

That's when the call went out to police headquarters about a barricaded gunman. Two five-man Quick Response Teams were hurried to the scene. The building was cleared. Four rounds of 12 guage canisters containing tear gas were fired into the basement. Not to be outdone, a police sergeant at the courthouse hurled a tear-gas grenade into the stairway, according to accounts.

Then, after the specialty teams had stormed into the basement to find a gun - the guard's revolver - but no prisoners, a call came from the jail.

Not only had police in the jail found all nine prisoners inside the vans, but had discovered a second gun - a .22 caliber shells, as well.

The nine prisoners were isolated at the jail. Tuesday evening, police said they had one suspect in the shooting.