The Houston area's courts are going to be a lot more diverse thanks to a group of 17 African-American women.

The women, who were part of an effort dubbed the "Black Girl Magic" campaign, all won races on 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 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 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 defence 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," Ms Gray said.

US midterm results: more diverse, more female and more progressive Show all 20 1 /20 US midterm results: more diverse, more female and more progressive US midterm results: more diverse, more female and more progressive Democratic candidate Ilhan Omar is celebrates with her husband's mother after she won a congress place, becoming the first Muslim woman to be elected into congress alongside Rashida Tlaib Reuters US midterm results: more diverse, more female and more progressive Democratic House candidate, from Kansas, Sharice Davids (left) and her mom Crystal celebrate after she won. Davids is the first lesbian Native American Congresswoman by beating Republican incumbent Kevin Yoder. Davids is one of several first-time female candidates that helped the Democratic Party takeover in the House of Representatives EPA US midterm results: more diverse, more female and more progressive Republican Marsha Blackburn celebrates after winning the race for senate in Tennessee. In doing so she became that state’s first female senator AP US midterm results: more diverse, more female and more progressive Supporters of Democratic House candidate Sharice Davids cheer and cry after learning she won EPA US midterm results: more diverse, more female and more progressive Ayanna Pressley beaome Massachusetts’ first black congresswoman by defeating 10-term Republican Michael Capuano AFP/Getty US midterm results: more diverse, more female and more progressive Republican candidate Young Kim has become the first Korean-American woman elected to Congress AP US midterm results: more diverse, more female and more progressive Democrat Jared Polis won his seat and became the US’s first ever openly gay governor AAron Ontiveroz/The Denver Post via AP US midterm results: more diverse, more female and more progressive Jean Kasselman (left) and Teresa Booker, supporters of Democratic candidate for Kansas' 3rd Congressional District Sharice Davids, react to election results Getty US midterm results: more diverse, more female and more progressive Republican Kristi Noem hugs a supporter after being announced as the new governor of South Dakota. Noem made history by being the first female governor of the state AP US midterm results: more diverse, more female and more progressive Gabierla Martinez and Cesar Delgado cheer on Democratic gubernatorial candidate Jared Polis REUTERS US midterm results: more diverse, more female and more progressive Alexandria Ocasio-Cortez became the youngest women ever elected to Congress, representing New York’s 14th congressional district AFP/Getty US midterm results: more diverse, more female and more progressive Democratic congressional candidate Rashida Tlaib celebrates with family and friends at her midterm election night party in Detroit after won and also became the nation’s first Muslim woman to congress alongside Ilhan Omar who was also elected Reuters US midterm results: more diverse, more female and more progressive Supporters of Democratic candidate for Kansas' 3rd Congressional District Sharice Davids react to election results Getty US midterm results: more diverse, more female and more progressive Already having become the first Native American woman to chair a state political party, Deb Haaland has now become the joint-first Native American woman to be elected to congress, alongside Sharice Davids Reuters US midterm results: more diverse, more female and more progressive Supporters of Alexandria Ocasio-Cortez cheer during her election night party in the Queens Borough AFP/Getty US midterm results: more diverse, more female and more progressive Young Kim hugs her son Alvin after she won a seat in congress AP US midterm results: more diverse, more female and more progressive Supporters of Alexandria Ocasio-Cortez cheer AFP/Getty Images US midterm results: more diverse, more female and more progressive Asma Mohammed and Ashley Fairbanks celebrate as results come in at Democratic congressional candidate Ilhan Omar's election night headquarters AP US midterm results: more diverse, more female and more progressive Democrat Deb Haaland hugs a voter REUTERS US midterm results: more diverse, more female and more progressive Supporters of Democratic House candidate from Kansas Sharice Davids cheer and cry after learning she won her race EPA

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 has 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 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 US trial judges are white, according to a 2016 report by a liberal legal organisation, the American Constitution Society. The group found less than one-third of state judges were women and less than one-fifth were people of colour.

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

According to US Census figures, African-Americans make up about 20 per cent 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 black women have been elected as family court judges and as judges on misdemeanour criminal courts in Harris County.

"We felt showcasing the number of African-American women on the bench would galvanise our base and also galvanise those who don't typically vote in the midterm elections and get them excited about coming out," Ms 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."

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