The Energy Department violated federal appropriations law by sharing on social media a column written by Secretary Rick Perry criticizing Obamacare, the U.S. Government Accountability Office said Thursday.

GAO said a July 2017 tweet from the Energy Department's media team violated the "purpose statute" because tweeting about Perry's views on healthcare is not a proper use of money appropriated to the agency by Congress.

"Energy did not provide any explanation or make any particularized showing that communicating about healthcare is part of its work or is related to accomplishing its statutory mission," the GAO said in a report it issued at the request of Rep. Frank Pallone of New Jersey, the top Democrat of the House Energy and Commerce Committee.

[Also read: Rick Perry cheers first natural gas export terminal on East Coast]

The Energy Department's Office of Public Affairs tweeted a July 2017 opinion piece written by Perry for cleveland.com in which the energy secretary opined on healthcare policy, calling for the enactment of “patient-centered reform” that “empower[s] the states."

Perry wrote that “millions of Americans are depending on their representatives to repeal this crushing law and can benefit from the common-sense solutions being considered in the Senate.”

He also advocated for a pending reform law authored by Republicans in the Senate that included “many positive reforms to Medicaid” and “would give states more control to deliver better care at lower costs for those in need."

The account @EnergyPressSec tweeted: “Time to discard the burdens and costs of Obamacare: @SecretaryPerry” and linked to the column. The Energy Department later deleted the tweet that day.

GAO said the tweet did not violate other federal laws preventing agencies from political lobbying or issuing propaganda, because it did not make a direct appeal for action.

"Energy did not violate the prohibition on using appropriated funds for grassroots lobbying or for publicity or propaganda," the report said. "Neither the tweet nor the secretary’s column to which it linked contained a clear appeal to the public to contact members of Congress about pending legislation. In addition, neither the tweet nor the column constituted covert propaganda, purely partisan communications, or self-aggrandizement."

Shaylyn Hynes, an Energy Department spokeswoman, said the agency disagrees with GAO's finding that the tweet violated the "purpose statute." She said the Energy Department's statutory responsibilities include components involving medical research and improving healthcare.