BOSTON — The highest court in Massachusetts has vacated the murder convictions of two men found guilty of fatally shooting a bystander in 2007 because the trial judge improperly allowed prosecutors to dismiss at least one Black person from the pool of prospective jurors.

The Supreme Judicial Court’s decision Monday vacated the convictions of Antwan Carter and Daniel Pinckney, who were convicted of killing 18-year-old Cedric Steele in Boston in 2010 after two previous trials ended in hung juries.

Prosecutors have said that Carter and Pinckney wanted to shoot members of a rival gang who had shot at their friend, but mistakenly shot Steele.

The high court said the trial judge should have required the state to explain why it wanted to exclude a Black prospective juror, who was the same race and approximate age of the defendants.

“We conclude that it was an abuse of discretion for the judge not to require the Commonwealth to provide a race-neutral reason for its challenge of at least one African-American juror,” the court wrote.

The office of Suffolk District Attorney Rachael Rollins said it is still weighing whether to try Carter and Pinckney again. They remain behind bars.