Secretary of Energy Ricky Perry on Friday declared his support for President Donald Trump's ban on transgender troops.

In a series of tweets on Wednesday, Trump declared that the military will no longer “accept or allow” transgender troops to serve “in any capacity.”

(Related: Trump says military will bar transgender troops.)

The following day, the Pentagon clarified that the policy on transgender troops had yet to change.

(Related: Pentagon: No official change has been made on transgender service.)

Perry, who served as the 47th governor of Texas from December 2000 to January 2015, made his remarks while touring an air conditioning plant in Waller, Texas.

“I totally support the president in his decision,” Perry is quoted as saying by The Texas Tribune. “The idea that the American people need to be paying for these types of operations to change your sex is not very wise from a standpoint of economics.”

In his announcement, Trump said that the ban was needed to avoid the “tremendous medical costs and disruption” posed by transgender people serving in the military.

When a reporter pointed out that the military spends ten times as much on erectile dysfunction medication than the estimated costs of gender reassignment surgery, Perry joked: “You know what, I don't check on the price of Viagra.”

Perry, 67, lost the Republican presidential nomination to Trump.