Image copyright Getty Images Image caption The Swalec Stadium - now renamed Sophia Gardens - hosted the 2017 ICC Champions Trophy semi-final

Cardiff council has said it stands by its decision to write off millions owed to it by Glamorgan cricket club.

It wrote off £4.4m to ease the club's finances in 2015 and maintain a Test cricket ground in the city.

But the club's finances have since improved, partly due to a £2.5m deal with the England and Wales Cricket Board (ECB), which stops the club bidding for Test matches.

Critics said it was "unfair" taxpayers were "losing out".

The Labour-led authority told the BBC's Wales Live programme the "fundamental reasons" for the write-off still stood and it was pleased Glamorgan was now more financially secure.

But opposition Conservative councillors said taxpayers would be "astonished" the council would not benefit from either the ECB payment or from hosting Test matches.

Glamorgan County Cricket Club was given a loan by Cardiff council in 2006, but the authority wrote-off £4.4m - 70% of the debt - in 2015, as the club was deep in the red after spending to bring its stadium up to international standard.

One of the reasons the council wrote-off the debt was to retain a Test match venue in the capital city.

But in return for a £2.5m payment from the ECB, Glamorgan agreed not to bid to host England Test matches between 2020 and 2024.

The club will host an England T20 international every summer between 2020 and 2024, and a one-day international in 2021, 2023 and 2024.

It will also be a host city for the new 100-ball domestic competition.

Image caption Chris Weaver of Cardiff council said the write-off had put the club on a "better platform" for the future

A council source told Wales Live: "Lawyers are saying that if the council wanted to trigger a conversation about claw back it could."

But Cardiff council's cabinet member for finance, Chris Weaver, said he did not think the ECB payment "changes the fundamentals behind that necessary decision in 2015".

And he said the council would focus on recouping part of the loan it was still owed:

"The important thing is that we not only bring back that £2m but that we also have a viable and successful stadium in the heart of the city that will bring economic benefits for all of our citizens in years to come."

He added he was pleased about the games Glamorgan had secured.

"It would be fantastic to have Test cricket in Cardiff and hopefully we will do again," he said.

"But what I understand is the club have made a decision to focus in the medium term on some very successful cricket matches they can put on."

Image copyright PA Image caption Cardiff hosted the First Ashes Test in 2009 between England and Australia

But the council's Conservative opposition leader, Adrian Robson, said the situation was unfair on taxpayers.

"Cardiff council gave strong financial support to Glamorgan Cricket Club during their difficult times for example helping them bid for and stage the 2009 Ashes and writing off the loan," he said.

"Yet now Glamorgan Cricket Club are starting to turn the corner, the first beneficiary is the bank.

"To many it looks like a one-sided partnership with the council losing out."

The payment to Glamorgan led to resignations from the ECB board, and is now being reviewed.

Andy Nash, who was the first person to quit the board said he was not involved in any discussion about the payment and was "completely unaware of it".

But he added: "I don't think Glamorgan as far as I'm concerned have done anything wrong.

"If they were able to persuade anyone to give them a substantial payment that was in pursuit of their own financial objectives, then good for them."

A Glamorgan spokesman said: "The England and Wales Cricket Board is currently engaged in an inquiry and until it is concluded we are not in a position to make any comment."

BBC Wales Live is on BBC One Wales at 22:30 BST on Wednesday 16 May.