Two or more defendants may be jointly charged with a felony and tried if they are alleged to have participated in the same act or transaction or in the same series of acts or transactions constituting an offense. The defendants may be charged in one or more counts and tried together or separately and all of the defendants need not be charged in each count.
If it appears that a defendant is prejudiced by a joinder of defendants in a complaint or indictment or by joinder for trial together, the court may, upon motion of the defendant or the court's own motion, order an election or separate trials of counts, grant a severance of defendants, or provide whatever other relief justice requires. In making its determination, the court shall consider the impact on the victim. In ruling on a motion by a defendant for severance, the court may order the prosecutor to deliver to the court for inspection in camera any statements or confessions made by the defendants which the prosecution intends to introduce in evidence at the trial.