Rick Perry
Secretary of Energy Rick Perry testifies during a House Energy and Commerce Committee hearing on Capitol Hill, in Washington, D.C., Oct. 12, 2017. Getty Images

Social media backlash was prompt and unsparing after Energy Secretary Rick Perry suggested Thursday that the development of fossil fuels would play a "positive role" in preventing sexual assault in Africa.

Perry, who traveled to Cape Town, South Africa, in October in order to discuss oil and gas partnerships in the country, tied the sexual assault issue to the lack of electricity on the continent.

While speaking during an energy policy discussion with "Meet the Press" host Chuck Todd and Axios CEO and founder Jim VandeHei, Perry discussed his recent trip to Africa.

"It's going to take fossil fuels to push power out into those villages in Africa," the secretary said at the forum hosted by Axios and NBC News. "A young girl told me to my face, one of the reasons that electricity is so important to me is not only because I'm not going to have to try to read by the light of a fire and have those fumes literally killing people, but also from the standpoint of sexual assault."

"When the lights are on, when you have light that shines, the righteousness, if you will, on those types of acts," he continued. "So from the standpoint of how you really affect people's lives, fossil fuels is going to play a role in that. I happen to think it's going to play a positive role."

The comment was criticized by social media users and environmental groups equally. Many Twitter users also were uncomfortable with the fact that Perry used just one girl’s story of sexual assault in order to advocate a form of energy development.

The Sierra Club, an environmental organization in the U.S., which supports wind and solar power, described Perry's comments as "blatantly untrue."

The group's director, Michael Brune, said in a statement: "To suggest that fossil fuel development will decrease sexual assault is not only blatantly untrue, it is an inexcusable attempt to minimize a serious and pervasive issue."

"Rick Perry's attempt to exploit this struggle to justify further dangerous fossil fuel development is unacceptable. He should resign from his position immediately before he causes any more damage," ABC News reported.

The Energy Department attempted to clarify Perry’s comments in a tweet posted on its account.

"The Secretary was making the important point that while many Americans take electricity for granted there are people in other countries who are impacted by their lack of electricity," the Department of Energy tweeted Thursday night.

"The Secretary just returned from Africa, where people made the point to him directly over and over about the impact that power has on their citizens," the statement read. "He was told about how light can be a deterrent to sexual assault and security in remote areas."

Perry, who has been a former governor of Texas, has already been well-known for his mistakes made during his 2012 bid for the U.S. presidency. He reportedly had dropped out of the race after famously failing to recall the name of the agency he now heads, which he had promised he would abolish if he had been elected. In July this year, serving as energy secretary, he was duped by Russian pranksters, who made Perry believe that he was speaking to the Ukrainian prime minister, according to BBC News.