AUSTIN, Texas (Reuters) - Texas A&M University said on Thursday it respectfully disagreed with comments U.S. Energy Secretary Rick Perry made a day earlier when he criticized an election at his alma matter that led to the school’s first openly gay student body president.

FILE PHOTO: Former Texas Governor Rick Perry testifies before a Senate Energy and Natural Resources Committee hearing on his nomination to be Energy secretary at Capitol Hill in Washington, U.S., January 19, 2017. REUTERS/Carlos Barria/File Photo

In an opinion article submitted to the Houston Chronicle’s editorial board published on Wednesday, Perry, a former governor of Texas, said the Texas A&M student election may have been rigged to secure a result that projected diversity at a campus known for being conservative.

The comments set off a social media debate in Texas where some questioned why a member of the president’s cabinet keeping an eye on the U.S. nuclear arsenal needed to weigh in on a student election. Others applauded him for bringing attention to what they see as a problem at one of the state’s flagship schools.

“We were surprised that he weighed in on the university student body election and respectfully disagree with his assessment,” university spokeswoman Amy Smith said in a statement.

Perry said the Student Government Association (SGA) Election Commission made a mockery of the election when it disqualified the person who secured the most votes for a minor procedural violation.

“At worst, the SGA allowed an election to be stolen outright,” he wrote.

Bobby Brooks, who came in second, became student body president after Robert McIntosh was disqualified on a charge he failed to provide receipts for glow sticks used in a campaign video.

“Now, Brooks’ presidency is being treated as a victory for ‘diversity.’ It is difficult to escape the perception that this quest for ‘diversity’ is the real reason the election outcome was overturned,” wrote Perry, who as governor helped lead the charge to ban same-sex marriage in Texas.

University spokeswoman Smith said the decision was correct, adding “to suggest that the same decision of disqualification would not have been made if the roles were reversed is to deny the Texas A&M of today where accountability applies to all.”

In comments to the student newspaper The Battalion, McIntosh said he did not know of Perry’s plans to complain about the election and was appreciative of the support.

Brooks has not spoken to media about the Perry letter but has said he wanted to use his new post to help make the school more inclusive.