Councils spent over £3 million more than they were estimated to need mitigating the "bedroom tax" last year, official figures show.

The Scottish Government thought councils would need £47.2 million for discretionary housing payments (DHPs), used mainly to top up benefits cut from those deemed to have spare bedrooms in 2014/15.

Councils actually spent £50.5 million but this figure would have been even higher if it was not for an underspend across 14 councils.

East Dunbartonshire and West Lothian spent 129% of their estimated need while Stirling and the island councils spent less than a quarter of their estimated need.

The total overspend by 18 councils was £4.5 million - equivalent to almost the entire spending in Edinburgh - while 14 councils underspent by £1.2 million.

The Scottish Government will now have to spend the entire £3 million it was holding in reserve to reimburse local authorities against their actual expenditure.

Westminster handed Holyrood the power to lift the formerly legally binding limit on DHP spending of £38 million in November and it was subsequently lifted the following month.

But by that time councils were already £8 million over the limit at £46 million.

Councils spent a third of the former cash limit in the first month of 2014/15 alone, totalling £13 million in April.

The statistics report stated: "Crucially, from 2014/15 onwards, there is no longer a cap on local authority DHP expenditure in Scotland."

It added: "Overall, local authorities have exceeded the £47.2 million originally allocated. This is in anticipation of receiving the £3 million still to be allocated.

"As at March 31 2015, local authorities spent 107% of the £47.2 million so far allocated for 2014/15."

Housing minister Margaret Burgess said: "Discretionary housing payments are a lifeline for tenants who need extra help with housing costs or to offset the harmful effects of the bedroom tax which was introduced by the UK Government in 2013 and affects over 70,000 Scottish households.

"The Scottish Government is providing £35 million this year to ensure every local authority in Scotland will have sufficient funding to fully mitigate the bedroom tax whilst also protecting non bedroom tax elements of DHPs.

"Using the new powers coming to Scotland, the Scottish Government will abolish the bedroom tax as soon as possible.

"We continue to do all we can to limit the damaging effects of the UK Government's welfare cuts which impacts on some of the poorest and most vulnerable in our society.

"Our current and planned funding will result in an investment of around £296 million over the period 2013/14 to 2015/16 to help those most in need."