Lupe Valdez made history on Tuesday night by becoming the first Latina and the first openly gay person to win a major party’s nomination for governor in Texas, narrowly defeating Andrew White, a Houston businessman, in the Democratic primary runoff.

“I’m extremely honored,” Ms. Valdez said on Wednesday, adding that she had been up since 4 a.m. responding to congratulatory texts and emails, followed by a three-mile walk with her dogs.

“I guess I was a little full of energy,” she said.

Ms. Valdez, 70, a former Dallas County sheriff, will face off against Gov. Greg Abbott, the Republican incumbent with a $41 million war chest, who is expected to win in November. It has been nearly 30 years since Texas voters elected a Democrat as governor.

“This election is not going to be bought,” Ms. Valdez said. “Everywhere we go there is so much energy and so much enthusiasm, because people are ready for a change.”