Secretary of Energy Rick Perry has criticized the election of an openly gay student president, suggesting that the election was stolen.

Perry, a former Texas governor and failed presidential candidate, complained in an op-ed for the Houston Chronicle that the election of Bobby Brooks to lead Texas A&M was rigged in a “quest for diversity.”

Brooks became president after the top vote-getter, Robert McIntosh, was disqualified . The student government's judicial court found that McIntosh had failed to report a campaign expense but cleared him of a voter intimidation charge, according to The Battalion, the school's student newspaper.

“Brooks' presidency is being treated as a victory for 'diversity,'” wrote Perry, an alum of Texas A&M. “It is difficult to escape the perception that this quest for 'diversity' is the real reason the election outcome was overturned. Does the principle of 'diversity' override and supersede all other values of our Aggie Honor Code?”

Campus Pride, a group that represents LGBT college students, called Perry's comments an attack on the LGBT community.

“Surely, Secretary Perry has better things to do with his time than writing editorials about student elections at his alma mater?” said Shane Windmeyer, the group's executive director, in a statement.

Chad Griffin, president of the Human Rights Campaign (HRC), the nation's largest LGBT rights advocate, tweeted condemnation.

“Rick Perry, busy running a department he forgot he wanted to eliminate, somehow found time to smear a young gay trailblazer in Texas,” Griffin messaged. “Did @SecretaryPerry use DOE resources to defame gay student in support of son of a Trump supporter?”

Perry is a vocal opponent of LGBT rights, including opposition to marriage equality, repeal of Don't Ask, Don't Tell, and allowing openly gay adult leaders in the Boy Scouts of America.