Many Harris County residents didn’t expect Democrat Lina Hidalgo to be elected county judge.

Hidalgo is 27 years old. This was her first bid for public office. And during the course of the campaign, she didn’t even attend a meeting of the Harris County Commissioner’s Court.

In fact, some of incumbent County Judge Ed Emmett’s supporters seem to see Hidalgo’s election as a terrible accident, the result of straight-ticket voting, in conjunction with ballot placement, during a blue wave fueled by an angry and energized left.

That’s not fair to Hidalgo, though. She was surely the beneficiary of the surge in Democratic turnout that Harris County saw this year, but she didn’t win for that reason alone. She earned the votes she needed by campaigning for them. She’s earned the confidence of some Harris County voters.

Read more: Hidalgo, surprise victor in Harris County judge race, prepares to lead

She wants to promote opportunity and improve equity across the county, to advocate for underserved communities and work with Houston’s city leaders on common goals. That message resonated in Tuesday’s general election.

Texas Republicans weren’t necessarily alarmed when Harris County went blue in 2016. Some of them were confident that it would turn red again this year.

It didn’t. This was a midterm election cycle, but Texans were more energized than usual. In Harris County alone, more than 1.2 million voters mobbed the polls.

The result was such a serious blue wave that even some Democrats were distressed by the results. There are a number of Republican incumbents in Harris County who have won re-election in past cycles thanks to crossover support from Democrats. Emmett is one example, and as usual, he outperformed all the other Republicans in countywide office.

But this time around, that wasn’t enough. Hidalgo edged Emmett by less than two percentage points.

That wasn’t an outright trouncing like the one Harris County Clerk Stan Stanart got courtesy of Democrat Diane Trautman, who defeated him by 12 percentage points. Still, it was a painful loss for the many Harris County residents who have come to rely on Emmett’s leadership as chief executive of Texas’s largest county.

Emmett led Harris County through Harvey, along with Houston Mayor Sylvester Turner. He has since emerged as a leading voice on flood control and an effective advocate for the region in its dealings with state government — which will still be led by Republicans when the Texas Legislature convenes for its next regular session in January.

Read more: Hidalgo, immigrant and first-time candidate, hopes to unseat popular Harris County judge

Still, three-quarters of Harris County voters chose the straight-ticket option this cycle and 55 percent of them opted for Democrats over Republicans.

A majority of ticket-splitters preferred Emmett to Hidalgo. There were 410,060 votes for the Republican ticket, and he received 575,101 votes in total.

Hidalgo, however, received 593,946 votes, and only 514,758 of those votes were cast for the Democratic ticket. In other words, nearly 80,000 ticket-splitters chose her, deliberately, as an alternative to Emmett. Her outreach to Latino voters in particular likely helped her cause.

Those voters weren’t necessarily hostile to Emmett. Hidalgo didn’t vilify him when we met, or disagree with my glowing assessment of his leadership during Harvey. Her pitch to voters was that they should expect more from Harris County’s chief executive, especially given the current state and national political debates that have outsized implications for the Houston region.

Grieder: Texans should put the election behind them and work together

Hidalgo is right, of course, that the Harris County judge has responsibilities other than disaster response. I didn’t find that to be a persuasive case against Emmett’s re-election, but others may have. Hidalgo may not live up to their expectations but I don’t see any reason to assume that she won’t.

And given the Texas GOP’s ongoing war on local control, Harris County voters should be careful before casting Hidalgo as a lightweight who fluked her way into office. She may not have been everyone’s preferred candidate. She may not live up to the standard set by Emmett in the event of a crisis like Harvey. She hasn’t held any office before; that’s true.

But she has already earned the confidence of some voters. Emmett’s supporters should give her the chance to earn theirs after she’s sworn in as Harris County judge.

erica.grieder@chron.com