A man in a cell squawks like a bird. Another presses his face against a window in the cell door and glares at passersby. A woman lies sleeping on a concrete bench in her cell.

Welcome to B-level, where sheriff's deputies receive, catalog and bring as many as 150 defendants a day to appear in Pima County Superior Court.

The judicial security detail of the Pima County Sheriff's Department has about 30 officers assigned to guard and transport inmates and to make sure peace, order and security are maintained in the courthouse.

It's a five-day-a-week dance where officers process defendants in for court appearances in the morning, then process them back out to the jail once the trials wrap up for the day.

"It's going to get really congested down here," Officer Q.L. Edwards said while standing in the muggy basement garage.

It does, and quickly, as vans full of defendants begin rolling through the sally port in the basement parking garage of the courthouse before 8 a.m.

Each van comes equipped with holding cells inside to keep the inmates separated.

Officers empty one van after another of shackled inmates who shuffle up a ramp into the small receiving area.

At the top of the ramp, an officer behind a chest-high desk greets the inmates and takes their identification cards.

He checks their names from a master list and clips the cards to a wooden board that hangs from the wall. Each clip sits under a number that represents the division, or courtroom, where the inmate is to appear.

It's an old-school process, some officers say, and a stark juxtaposition from the computers and surveillance monitors behind the desk, but it still works.

Soon, the cramped processing area becomes a choke point. Officers lead lines of inmates handcuffed together past a heavy steel gate into holding cells, while other officers bring similar groups of defendants out to wait for an elevator to take them up to the courtrooms.

Once beyond the heavy cell door, the true function of the basement becomes apparent: an off-site jail.

Holding cells built for individual inmates, or groups of as many as 17 defendants, line the narrow halls.

These "gang cells," so-called for the large groups of people they house, hold the inmates deemed low-risk.

The inmates banter with the officers and one another behind the heavy stainless wire-mesh cell doors.

"What's with the cameras?" an inmate asks.

Others joke and laugh, saying "No pictures, please" and "You want my autograph?"

In another gang cell, a group of male inmates stands in a circle holding hands, heads down in prayer in the moments before their court appearances.

In the individual cells, solid metal doors with small, rectangular windows separate the inmates from officers.

These inmates have been separated from the rest for various reasons: Some are juveniles facing adult charges. Others have to be protected from fellow inmates, and some have histories of violence.

The officers mark the segregated inmates' doors with magnetic panels alerting their colleagues what awaits inside. Some indicate a juvenile inmate, others female defendants or another marked "Cuff 2." Edwards said "Cuff 2" tells officers that two of them are needed to put the handcuffs back on the inmate.

On the door of one marked "Cuff 2" also hangs a black mesh net. Edwards said the inmate has to wear the mesh over his head because he's been known to spit at people.

The color of clothing the inmates wear also indicates something about their status. Most wear orange scrubs. Juveniles are clad in lime green, and those who need to stay away from others wear black and white stripes.

Once the defendants reach the upstairs courtrooms, after a ride in an elevator separated from an officer by a heavy jail-cell door, they are led into the courtrooms where they sit chained to one another in the jury box waiting for their cases to be heard.

Those facing trial get the chance to change into clothing their defense attorneys provide. Once in court, some of the arm restraints are removed. Different leg restraints can be used during the trial, like leg chains silenced with a length of black rubber hose slipped over the section of links.

The officers also use locking leg braces under the pants of incar-cerated defendants to prevent them from running away.

In addition to the tight security detail the officers run, the courthouse has camera surveillance watching over almost every inch of the building.

In all, 174 cameras monitor courtrooms, hallways and holding cells. Some of the administrative offices and nonpublic areas are not monitored.

While routine and efficiency usually rule the day, there have been times when chaos breaks the order.

Edwards said he remembered a case in which someone in the gallery tried to attack a defendant.

The man was there with other members of his family for the sentencing of a defendant convicted for killing a girl. They had been given the chance to address the court before sentencing.

"The girl had been raped, killed and burned," Edwards said.

In the middle of the statements, a man climbed the courtroom divider and tried to attack the man.

Officers had to restrain the man and lead him out of the courtroom.

Another time, a defendant who came to court a free man was sentenced and was to be taken into custody. He had second thoughts, though.

The man ran before the officers could put him into handcuffs. Not only did he make out of the courtroom, he managed to get out the front door of the courthouse before officers grabbed him and took him down to B-level, where a van was waiting.

Contact reporter Patrick McNamara at 573-4241 or pmcnamara@azstarnet.com. On Twitter @pm929.