A judge on Friday ordered a retrial in the case of a Code Pink activist who was arrested after she laughed during Jeff Sessions’s confirmation hearing for attorney general, officials said.

The woman, Desiree A. Fairooz, 61, of Bluemont, Va., was one of three demonstrators affiliated with the women-led activist group prosecuted in connection with the Jan. 10 hearing. All three had rejected a plea deal and demanded to go to trial. They were convicted by a jury in May.

In an April court filing, federal prosecutors had argued that the protesters shared a common goal to “impede and disrupt” the hearing and Ms. Fairooz had “created a scene.”

It was early in the hearing when Senator Richard C. Shelby, Republican of Alabama, said Mr. Sessions’s record of “treating all Americans equally under the law is clear and well-documented.”