The photo was unforgettable: 19 black women, all dressed in black, gathered in a mock courtroom in Thurgood Marshall School of Law. All of them were running for judgeships in November.

On Tuesday, 17 of them won their races by double-digits in Harris County, Tex., the nation’s third largest county, which includes Houston. Each of the lawyers, all Democrats ranging in age from 31 to early 60s, will join the bench in January for four-year terms in the civil, criminal, family and probate courts.

“Although we were doing everything we could — block walking, phone banking — I wasn’t confident that it would turn out the way it did,” said Latosha Lewis Payne, 44, a longtime lawyer in Houston who was one of the 17.

Each of the women decided individually to run. Some in the group had to win primary races in March. But once they realized they were all running against Republican incumbents in the fall, they rallied around a slogan called “Black Girl Magic” to celebrate the accomplishments of black women.