Image copyright Pacemaker Image caption The RHI Inquiry was set up three years ago to examine a controversial green energy scheme

Stormont departments are facing bills totalling almost £5.5m in legal fees related to the RHI Inquiry.

The Renewable Heat Incentive (RHI) scheme was set up in 2012 to boost uptake of eco-friendly heat systems.

But the flawed green energy scheme led to the establishment of a public inquiry in January 2017.

The legal bill for the four Stormont departments is in addition to the overall cost of the inquiry, which is projected to be up to £6.7m.

The figures published by the Department of Finance show the legal fees relate to the Executive Office, the Department of Agriculture, Environment and Rural Affairs (DAERA), the Department for the Economy and the Department of Finance.

The Department for the Economy had the highest legal fees, amounting to £3.9m between 2017 and 2019.

Stormont departments' legal fees for RHI Inquiry 2017/18 (£) 2018/19 (£) TOTAL (£) The Executive Office 362,229 728,000 1,090,229 DAERA 10,754 9,536 20,290 Department of Finance 171,263 201,138 372,401 Department for the Economy 1,770,000 2,210,000 3,980,000 Total 2,314,246 3,148,674 5,462,920

This covers legal advice and representation for individuals who were in the relevant departments during the period being examined by the inquiry.

The inquiry designated a number of organisations as "core participants", including the Department for the Economy and the Department of Finance.

It also had a list of enhanced participants that included former Democratic Unionist Party (DUP) Enterprise ministers Jonathan Bell and Arlene Foster and DUP special advisers Andrew Crawford and Timothy Johnston.

Core and enhanced participants were entitled to have legal representatives present at the public hearings on days considered by the chair of the inquiry to be relevant to them.

BBC News NI contacted each of the departments to see if they wished to comment, but has not yet received any responses.

Image copyright Pacemaker Image caption The RHI Inquiry's public hearings took place in Stormont's Senate Chamber

'Nearing completion'

Sir Patrick Coghlin, a retired Court of Appeal judge, chaired the RHI Inquiry.

Its key aim was to examine why the scheme did not contain the same cost controls as the one in Great Britain.

The inquiry examined how, during the last phase of devolution, special advisers wielded far greater amounts of power than they should have.

A new code of conduct for Stormont's special advisers and how they are appointed was published on Monday.

The final report of the RHI inquiry is understood to be "nearing completion".