HOUSTON — The East Texas woman who claimed President Obama was a drug-addicted gay prostitute in his youth was defeated in a Republican primary runoff election Tuesday, losing her bid to become one of the top education officials in Texas.

The woman, Mary Lou Bruner, 69, a former kindergarten teacher, had used her Facebook page to post her extreme views on politics and education. Ms. Bruner called the Boy Scouts “a homosexual organization” and declared that because of her conservative views, Mr. Obama “has had me investigated.” She encouraged parents to home-school their children because that was “the only way you can be in control of what they are taught,” and claimed that school shootings across the country had begun “after the schools started teaching evolution.”

Her postings drew national attention as she campaigned for a seat on the State Board of Education, the 15-member body that sets curriculum standards, adopts textbooks and establishes graduation requirements in Texas public schools. In March, Ms. Bruner earned the most votes in the Republican primary, winning 48 percent, but failed to get enough votes to avoid a runoff.

On Tuesday, Ms. Bruner was defeated by a wide margin by Keven M. Ellis, 45, a chiropractor who is the president of the school board in Lufkin. Because Republicans dominate the district, the winner of the Republican race is expected to beat the Democrat — Amanda M. Rudolph, a professor at Stephen F. Austin State University — in the general election.