HOUSTON — The Houston area's courts are going to be a lot more diverse thanks to a group of 17 African-American women and their "magic."

The women, who were part of an effort dubbed the "Black Girl Magic" campaign, all won races Tuesday to be judges in various Harris County courts in an election that featured more black women on the county's ballot than any other.

The "Black Girl Magic" campaign debuted over the summer with a viral photo that featured the 17 women and two other sitting Harris County judges inside a courtroom. Although those two judges lost their bids Tuesday for seats on the Texas Court of Criminal Appeals, they will retain their local judgeships.

Those behind the campaign say it was part of an effort to broaden the diversity of the Houston area's judiciary and ensure that more African-Americans and other minorities can bring their backgrounds and life experiences to the bench and better reflect the diversity of the nation's fourth largest city.

"I think that while Houston itself is one of the most diverse cities in the United States, our elected officials have not always reflected that," said Lillie Schechter, chair of the Harris County Democratic Party, which put together the "Black Girl Magic" campaign. "Having a government that reflects the people, the population is something that is incredibly important."

Lori Chambers Gray, a Houston defense attorney who won election to be a judge on a criminal district court, said the photo and the "Black Girls Magic" campaign provided her with a source of strength and motivation as she proceeded to Election Day.

"I hope that it's an example for women that we do have opportunities to run and to win a campaign," Gray said.

The "Black Girl Magic" moniker has been used as a hashtag in recent years to highlight the accomplishments of African-American girls and women. In politics, it's been used to highlight the role African-American women have played in helping decide various races, including the highly contested Senate race in Alabama last year in which Democrat Doug Jones beat Republican Roy Moore.

The victory by the 17 black women on Tuesday was part of a Harris County rout by the Democrats, who won almost all of the nearly 70 local judicial races and ousted a popular Republican from the county's top elected office.

Although Tuesday's election will increase the diversity of the Houston-area's judiciary, more than three-quarters of U.S. trial judges are white, according to 2016 report by a liberal legal organization, the American Constitution Society. The group found that less than one-third of state judges were women and less than one-fifth were people of color.

In Texas, women of color make up about 28 percent of the state's population but only about 12 percent of its state court judges, according to the American Constitution Society's report.

According to U.S. Census figures, African-Americans make up about 20 percent of Harris County's population. Tuesday's election will increase the number of black female judges in Harris County from eight to 25, according to the Harris County Democratic Party.

Angela Graves-Harrington, a family law attorney in Houston who was one of the 17 women elected, said Tuesday's success will be an important step in improving diversity, as this will be the first time that black women have been elected as family court judges and as judges on misdemeanor criminal courts in Harris County.

"We felt showcasing the number of African-American women on the bench would galvanize our base and also galvanize those who don't typically vote in the midterm elections and get them excited about coming out," Graves-Harrington said. "We also wanted to have something out there that we could be proud of, that our community could be proud of and that Harris County could be proud of."

Schechter said she hopes the successful election of the 17 African-American women inspires "candidates of all colors" to run for local offices.