A football club has won a court battle to play in the Welsh League after a row with Welsh football's governing body.
Barry Town FC was withdrawn from the league in May by its previous owner but the club's lawyers argued he was not involved in running it for two seasons.
The name was changed to Barry Town United by fans who had been running the club but they were denied full Football Association of Wales (FAW) membership.
A High Court judge in Cardiff ruled the FAW had acted unlawfully.
The FAW said it accepted the court's decision and the team is now expected to play in division three of the Welsh League.
The Vale of Glamorgan club faced playing recreational football if it lost the court case. It previously played in division one of the league.
Barry Town United had argued in court on Wednesday that it was entitled to be part of the league because it fulfilled the FAW's criteria to be one its member clubs and, consequently, play in the Welsh league.
Its barrister Jonathan Crystal told the court that previous owner Stuart Lovering had had no involvement in running the football team for two seasons before he decided to withdraw the club from the league in May.
He insisted that therefore the FAW should not have accepted the resignation because Mr Lovering's limited company, Barry Town AFC Ltd, did not in reality constitute the football club.
Mr Crystal also said that in the coming season Barry Town United would be playing at the same ground, under the same lease, with the same manager and the same players, in front of the same supporters, with the bills and fees being paid by the same people.
'Flawed and irrational'
On Friday, the court ruled in favour of Barry Town United.
Judge Seys Llewellyn QC ruled that the FAW council had acted unlawfully in refusing the club full FAW membership and entry into the Welsh League in June this year.
Its decision was "flawed" and "irrational" according to the judge.
His recommendation to the council was to admit Barry Town United to division three of the league.
The FAW council will now hold an emergency meeting on Wednesday but the FAW said it accepted the court's decision and would act on the recommendation made.
It had said in court that it had wanted the club to join the top division of the local South Wales League, one tier below the Welsh League.
The FAW had argued that it was normal at that level for supporters to fund the liabilities of a club, and it did not give them the right to assume the legal identity of the football club.
Meanwhile, Vale of Glamorgan council cabinet member for sport development and leisure services Gwyn John told BBC Radio Wales the matter should never have gone to court.
"I am asking the Welsh government to carry out a review of the governance of football in Wales," he said.