Although most infractions can be handled through less severe reprimands, or short incarceration in a brig, some crimes are so severe as to warrant a Courts-Martial. A Court-Martial is a trial under the Starfleet Code Of Military Justice, as opposed to Federation civilian law, and is normally conducted by a committee of officers.
Any officer of the rank of Captain or higher can submit a subordinate officer for immediate Courts-Martial (though frivolously abusing this right is itself a Court-Martial offense.) Officers of the Judge Advocate General's office have the power to submit any member of Starfleet for Court-Martial, as long as they submit an approved finding to a JAG officer of the rank of Captain or higher. Once it has been called, a Court-Martial is typically convened within seventy-two hours. As part of the formal order of Court-Martial, the presiding representative of the JAG’s office nominates both a prosecuting advocate and an advocate for the defense. Typically, both advocates are officers from the local JAG office. If no suitable JAG advocates are available, however, the JAG representative can nominate any available Starfleet officers as ad hoc advocates. The accused always has the right to refuse the nominated defense advocate and either serve as his own lawyer or appoint an eligible officer of his choice.
A panel of three judges presides over a courts-martial proceeding, usually officers from the JAG office. If none are available, the JAG office typically appoints and ad hoc judge -- the Fleet Admiral for the sector. Only officers ranked Commander or higher can serve as judges, and no officer with an obvious conflict of interest, such as friendship, is allowed to serve. If possible. the JAG representative who signs the order for Court-Martial appoints a full three-judge panel.
Procedurally, a Courts-Martial is handled very much like a civilian criminal trial. Both sides make opening statements, the prosecution presents its witnesses and evidence, the defense presents its case, and both sides make closing arguments. Each side has the right to cross-examine the witnesses presented by the other side, and almost all the rules of evidence and court room procedure applicable to civilian trials apply equally to Courts-Martial’s. Unlike civilian trials, however, Court-Martial proceedings do not employ juries; guilt or innocense is determined by the panel of judges. Courts-Martial’s tends to be less formal affairs, moving along at a much faster pace than a civilian trial, and rarely take more than a week to complete.