AUGUSTA, Maine — The recent controversial sale of state-owned property in Thomaston to the Maine State Prison warden violated state law and is therefore void, according to the state’s attorney general.

The sale in question involved three separate pieces of land at 22, 26 and 30 Ship Circle that were offered to Warden Patricia Barnhart and another buyer, Sheehan Gallagher.

According to published reports, Barnhart and Gallagher paid approximately $175,000 for the parcels — well below the $458,000 assessed by the town — and planned to turn some of the land into a subdivision.

After the sale prompted concerns from legislators late last month, state Finance Commissioner Sawin Millett asked Attorney General William Schneider to weigh in.

“Because Ms. Barnhart is employed by the state as the warden of the Maine State Prison, and was so employed during the time period in which this transaction took place, it is my opinion that the contract, release deed and lease and memorandum of lease are void under the terms of Title 17, section 3104 of the Maine Revised Statutes.” Schneider wrote to Barnhart in a letter dated July 8.

That section of state law says no one holding a position of trust in state government may have a financial interest in any contract made on behalf of the state, and any contract that violates those conditions will be void.

Around the same time Schneider issued his opinion publicly on Monday, Gov. Paul LePage’s office announced an executive order that sets up internal policy guidelines for future sale of state-owned real estate.

“While it is disconcerting that questions about this sale were not raised during this process, I am confident the measures I am now taking will prevent similar situations from occurring in the future,” LePage said, adding that he had no knowledge of the transaction until last week. “The people’s business is to be done openly and Mainers must be able to trust the process in which state business is conducted.”

Schneider’s letter indicated that the two sides should plan to meet soon to begin the process of “unwinding” the sale.

Barnhart was not available for comment at the Maine State Prison on Monday, but the attorney general’s opinion is not expected to affect Barnhart’s employment, according to Maine Deputy Corrections Commissioner Jody Breton.

Lawmakers got wind of the sale last month and began asking questions. Sen. Roger Katz, R-Augusta, who is chairman of the Government Oversight Committee, requested files of the sale from the state Bureau of General Services and the town of Thomaston.

State Bureau of General Services Acting Director Betty Lamoreau previously defended the sale and said her agency was under pressure from the Legislature to sell any property that might help balance the state budget. Lamoreau also said the town’s assessment of the property was not current and the actual value was closer to what Barnhart and Gallagher paid.

The lot in Thomaston includes three buildings, including a house occupied by Barnhart since she became warden in 2009 that traditionally has been provided by the state to wardens as part of their compensation.

Thomaston’s Planning Board was scheduled Tuesday to consider Barnhart’s request for a seven-lot residential subdivision on the site.