A LEGAL firm was paid almost £500,000 after health chiefs signed a contract blamed for costing taxpayers tens of millions of pounds.

International legal firm Pinsent Masons racked up fees of £435,397 while working on behalf on NHS 24 to help commission a new state-of-the-art IT system known as its 'Futures Programme'.

Former NHS 24 chief executive John Turner last month accused the lawyers of allowing him to agree to a contract with technology firm Capgemini that later transpired had key omissions.

After the deal was signed, the IT project descended into chaos with the rollout of a new system currently predicted to be three years late and cost £125 million - £50 million more than originally planned.

It is understood NHS 24 is considering legal action to recoup costs, with the matter to be discussed at a board meeting later this week.

It also emerged that the health body, which offers medical advice over the phone, also spent £371,000 on Pricewaterhousecoopers in the early days of the project. But there were no concerns raised over the quality of heir work.

The disclosure over the legal fees came in a letter to Holyrood's public audit committee, which last month grilled Dr Turner over his role in the contract when MSPs questioned why action was not taken when became concerned that over the legal advice.

He claimed that despite omissions from the contract being identified by his staff, he only discovered key elements were missing from a deal with Capgemini 22 months after he signed the contract.

Dr John Turner accused Pinsent Masons of withholding information from him during briefing sessions after MSP Colin Beattie said there were "questions" about the firm's role in the process.

A spokesman for Pinsent Masons said: "We can confirm that Pinsent Masons was instructed by NHS 24 in relation to certain procurement and legal matters under the Futures Programme. We cannot comment substantively upon the nature of our engagement by NHS 24 nor on comments made at the Audit Committee hearing of the Scottish Parliament due to our on-going duty of confidentiality to NHS 24."

The new NHS 24 call handling system was originally due to be rolled out in 2013. However, it was hit with a series of setbacks leading NHS 24 to launch separate legal action against contractor Capgemini that has since been dropped.

The system was finally due for launch last November, but was abandoned within days on the grounds of patient safety after staff struggled to use the new program and it was hit with a database failure.

Health chiefs have said that vital call handling times were twice as long as normal over the weekend it was brought in and staff were eventually told to use pens and paper instead.

NHS 24 has admitted that "systemic failures" lay behind huge budget overruns and repeated delays, with the new system now set to be relaunched by the summer. After it emerged that NHS 24's project was in difficulty, the Scottish Government called in Ernst & Young to conduct a review at a cost of another £58,700.

Paul Gray, the Chief Executive of NHS Scotland, and Sarah Davidson, a senior Scottish Government official, are due to give evidence to the public audit committee about the project tomorrow.

A spokeswoman for NHS 24 said: "Any IT programme of significant scale will incur considerable professional feeds and the management of the Future Programme has been no exception to this."