An agreement has been reached between the UK and Scottish Governments on how Holyrood will be funded when new powers are devolved.

Both sides have now said a deal has been reached, following months of talks. Nicola Sturgeon outlined the agreement at the Scottish Parliament on Tuesday.

The discussions had centred on how the block grant Scotland receives from Westminster will be adjusted when tax-raising powers are devolved.

The First Minister said the deal meant there would be a six-year period where there would be "no detriment" to Scotland's budget, followed by a review in 2021.

The draft version of the agreement will be submitted before the Scottish Parliament by the end of the week, she said.

She said: "This deal will not allow a single pound or even a penny to be taken from Scotland's budget.

"It protects the Barnett Formula and allows the powers in the Scotland Bill to be delivered."

Secretary of state for Scotland David Mundell said: "I am very pleased that we have agreed a deal on the fiscal framework with the Scottish Government. It has been a long negotiation, but we have got there in the end.

"I have always been confident that we would, because I know Scotland’s two governments can work together to reach agreements which are in the best interests of Scotland and the whole of the United Kingdom.

"It shows that we are fulfilling our commitments and making devolution in Scotland work, just as the Scottish people have said they want.

"This is a genuinely significant moment in the Scottish Parliament’s history, as this agreement will enable it to take on unprecedented new powers and responsibilities, and to become more accountable. The debate is now truly about how the new powers will be used to improve the lives of people in Scotland."

Scottish Labour leader Kezia Dugdale said: "I welcome the news that an agreement has been reached on the fiscal framework. This is a historic moment for Scotland and one that we should all celebrate.

"Scottish Labour’s position has been clear all along – we would only support a deal that protected the Barnett formula which has benefited generations of Scots. It appears that this deal does exactly that and has our support.

"Now that an agreement has been reached every single political party in Scotland must focus on what we can do with these major new powers. The opportunities they provide are huge – we can use the new tax and welfare powers to bring an end to Tory austerity and build a fairer country."

The First Minister told the Scottish Parliament earlier on Tuesday that the Treasury had submitted new proposals for the "fiscal framework", saying there had been "movement" towards the Scottish Government's position.

Deputy first minister John Swinney met chief secretary to the Treasury Greg Hands in London on Friday for the tenth round of talks between the two sides.

Updating MSPs on the discussions on Tuesday afternoon, Ms Sturgeon said the two sides were close to an agreement on all issues except the block grant adjustment.

She said Scotland had been promised the powers "freely and unconditionally" and did not have a "price tag" attached.

Lord Smith of Kelvin, whose commission drew up the initial cross-party blueprint for devolving more powers to Scotland, said: "Today's agreement between the Scottish and UK governments sees the recommendations of the Smith Commission delivered in full.

"The next term of Scottish parliamentarians will be debating and taking decisions over large parts of Scotland's tax and welfare policy. I believe this will be transformational for our Parliament.

"There should be no doubt that this was a highly complex package of measures to agree. It is difficult to imagine a bigger test of inter-governmental relationships and while it was obviously a very tough negotiation, what matters is that an agreement was reached. This provides an excellent basis for constructive engagement between the governments long into the future.

"When the Smith Agreement was passed to the Prime Minister and First Minister, both gave their word that they would deliver it into law - they have met that promise in full.

"I pay particular tribute to the deputy first minister and chancellor for reaching agreement on the final part of a historic package of new powers."