Early in the 2000s, Harris County, like many metro areas, shifted slowly toward the Democrats: Barack Obama carried it by about 18,000 votes in his first election and by less than 1,000 votes in 2012. But in 2016, the dam burst. Hillary Clinton beat Trump in the county by more than 160,000 votes, and Democrat Ed Gonzalez ousted a Republican incumbent as county sheriff by 73,000 votes.

Ogg’s victory may have been the most head-turning. It came after Republican incumbent Devon Anderson had tried to rally local conservatives by describing Ogg as “a liberal, pro-choice lesbian.” After the election, Ogg described that moment as akin to the common “bad dream” where you show up at school with no clothes on. “I had to magnify that thing that I was so afraid of. And so we just sent it out to everybody … it was so freeing,” she told a local LGBTQ magazine last summer. Ogg’s victory continued a striking trend in urban Texas: Two other openly gay women, Annise Parker and Lupe Valdez, had earlier won elections as Houston’s mayor and the Dallas County sheriff, respectively. (Valdez on Tuesday won the Democratic nomination to face Republican Governor Greg Abbott in November.)

After assuming office in early 2017, Ogg implemented an overhaul, quickly firing over three dozen prosecutors. “I did not trust … the architects of the system that I ran against to work with me to rebuild it,” she told me in an interview. “I also diversified the leadership, and I think that that was critical in the most diverse city in the country.”

Last February, Ogg joined with Houston Mayor Sylvester Turner, Sheriff Gonzalez, and Houston Police Chief Art Acevedo to announce a new policy that decriminalized possession of four ounces or less of marijuana. Now, people caught with those amounts are not arrested or even ticketed, but instead sent to a drug-education class. According to the DA’s office, through mid-May, nearly 5,200 people had been diverted from the courts through the misdemeanor marijuana program.

Ogg then targeted enforcement of other drug laws. She stopped prosecuting people caught with residue amounts of drugs other than marijuana that are too small to use—about 2,000 cases a year, she estimates. And she said she’s sent about 6,000 people caught with slightly larger amounts of drugs, particularly crack cocaine and methamphetamine, to a special “reintegration” court “for treatment through a mechanism that still allows them to keep their records clean.” She’s also backed an array of other diversion programs for other nonviolent crimes, including one that eliminates jail time for small retail thefts.

Ogg says all of these ideas promote fiscal responsibility: Until the marijuana diversion program went into effect, she notes, the county had been spending $27 million annually locking up low-level offenders. She also argues that these policies advance social equity by leaving fewer people scarred by a criminal record that harms their long-term employment prospects.