Superior Court spokeswoman Karen Dalton says the attack occurred Thursday morning while a prosecution witness was testifying.
The spokeswoman says attorney William Burgener was cut across the cheek, allegedly by his client, 32-year-old Eduardo Macias.
Macias and two other men are on trial for attempted murder, assault with a deadly weapon by a prisoner and conspiracy.
The U-T San Diego newspaper says the injured attorney was well enough to call a colleague in court shortly after the attack. Judge Peter Deddeh ordered a recess until Friday after another defense attorney asked for a mistrial.