SAN JOSE -- The lawyer for two nurses accused of stealing drugs from Santa Clara County Jail says his clients acted negligently, not criminally, when authorities caught them with prescription medications meant for inmates.

Elmer Alegado, 50, of Lathrop, and Rodolfo Idian, 54, a San Jose resident, were arrested last week. Riccardo Ippolito, their San Jose-based attorney, noted their lack of criminal histories and said there is no evidence the narcotics were being trafficked or used by his clients.

"There's more negligence than criminal intent involved," he said. "They wouldn't do anything to jeopardize their careers."

Instead, Ippolito argued, his clients were adhering to an unspoken practice of keeping on hand a few unused pills -- from instances like when inmates refuse to take their meds -- to make up for marginal shortages when drug inventories are checked.

"It's an extra pill or two in case they come up short at counting time," Ippolito said. "In this case it happened to be a controlled substance, but it's like how a casino deals with chips. We're not looking at these guys as stealing drugs to resell or having a drug habit they're trying to fuel."

To the Santa Clara County Sheriff's Office, which runs the jail and began investigating allegations of drug thefts by medical staff in late October, the explanation didn't pass muster. The agency said that when Alegado and Idian were arrested, they possessed prescription narcotics outside the scope of their duties. Officials were cryptic about the context, citing an ongoing investigation.

"Under normal working conditions, these were medications they would have access to. At the time of discovery, they were not authorized to have these medications," said Sgt. Jose Cardoza, a spokesman for the Sheriff's Office.

Typically, medication at the jail is stored in secure dispensers and any unused medication is supposed to be returned, according to sources. The harried pace of nursing shifts might sometimes lead to unused medication not being deposited back right away. But in the instance where an inmate declines to take his pills, the medication has already been recorded as dispensed, so there would be no immediate sign that anything's missing.

Both suspects are out of custody: Alegado posted bail and Idian was released on his own recognizance. Alegado's employment with the county ended on Oct. 31 while Idian was placed on administrative leave on Nov. 6. County officials would not comment on whether their status was a result of the investigation. Cardoza said it's unknown whether anyone else will be implicated.

During the investigation, the nursing staff at the jail had their lockers and personal belongings searched. The news of the arrests shook up the tight-knit group of nurses as they ponder additional fallout.

Ippolito insists his clients had no illicit intent.

"They're devastated," Ippolito said. "Their whole worlds are turned upside down because of this."

Contact Robert Salonga at 408-920-5002. Follow him at Twitter.com/robertsalonga.