Lupe Valdez celebrated after winning the Democratic nomination for governor of Texas on Tuesday.

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.”

In her acceptance speech on Tuesday night, she said she was weary of “constantly hearing, ‘This is going to be such an uphill battle.’”

“Please,” she added, “tell me when I didn’t have an uphill battle.”

Ms. Valdez joins a growing group of women — many of them Democrats — who have won primaries this year.

She grew up in what she described as the poorest neighborhood in San Antonio, the daughter of migrant workers and youngest of eight children.

She thrived, she said, because of public education, military training — she served as a captain in the Army — and access to health care.

Ms. Valdez attended what is now Southern Nazarene University in Bethany, Okla., where she supported herself with odd jobs. She joined the Army Reserves after graduating…