Plans to build a secure mental health unit in a village have been granted on appeal.
Wrexham councillors rejected proposals for the 54-bed facility in Gwersyllt in March on the grounds that it would be an over-intensive use of the site.
Developers ASC Real Estate Investments appealed, claiming councillors had unreasonable fears about the patients.
A Welsh Government planning inspector has now backed the scheme, saying the patients to be treated were low-risk.
The unit will provide care and treatment for adults with mental health issues, and will include an assessment and treatment unit to provide enhanced therapeutic support, according to the Local Democracy Reporting Service.
When the scheme was rejected in March, Chirk North councillor Frank Hemmings criticised some Wrexham planning committee members for suggesting the patients could be criminals or dangerous to children.
"They are people who need help and support," he said.
Explaining his reasons for granting permission on appeal, inspector Clive Nield said the plans were of "quite modest scale and would not represent over-intensive development of the site".
He added: "Although not clearly expressed in the reason for refusal, members' concerns appear to have included the level of security of the low secure unit and its compatibility with neighbouring residential areas and schools.
"In view of the secure nature of the unit and the low risk of its patients, I do not consider the proposed use would significantly affect the neighbouring land uses."
The proposals also include plans for six houses and 24 flats which would be built on part of the former industrial site.
The inspector attached a number of conditions to permission being granted covering road access, parking and the provision of affordable housing.