Labour and the Liberal Democrats have agreed a deal over the Welsh government's £14.5bn budget.
It includes an extra £20m to spend on the education of the poorest pupils.
The minority Labour administration in Cardiff Bay has been talking to opposition parties in an attempt to get its spending plans approved.
First Minister Carwyn Jones and Welsh Lib Dem leader Kirsty Williams hailed the deal, but it was criticised by the Conservatives and Plaid Cymru.
The first minister said other budget areas would not be cut to pay for the agreement.
Mr Jones told BBC Radio Wales: "There are no other budget areas that would be cut. We have looked at a number of areas where the money can be gathered.
"This is about as much as we can manage, but it's money that is going to be used for a good purpose in order to provide better educational opportunities for some of our most deprived children."
The extra money boosts the size of a pupil deprivation grant to more than £32m next year.
A Welsh government spokesman said it would mean £450 would go directly to schools for every child receiving free school meals.
There were 70,800 children entitled to free school meals in Wales last year.
The two parties have also agreed on the destination of a £39m windfall which the Welsh government received as a result of a council tax freeze in England.
To be spent over two years, it includes more money for businesses that recruit young apprentices and capital spending for a home energy efficiency scheme.
The agreement breaks weeks of deadlock in budget talks between Labour and the opposition.
With 30 of the Senedd's 60 seats, Labour needed at least one opposition member to ratify its budget.
Ministers had also been talking to Plaid Cymru, who called for increased spending to boost the economy.
The government had until Tuesday to table a final budget before a crucial vote on 6 December.
A Welsh government source indicated that Wales could receive a spending boost as a consequence of the Chancellor's autumn statement on Tuesday. Any additional funds would be spent "in consultation" with the Lib Dems.
'Make a difference'
Welsh Lib Dem leader Mrs Williams said the money - which the party has dubbed a pupil premium - would start to break a link between poverty and poor standards in schools.
She said: "It would have been easier politically to walk away, but the Welsh Liberal Democrats have instead worked with our political opponents to agree a budget for the good of Wales.
"We are proud that our influence will make a difference to children in Wales and provide a welcome boost to the economic recovery."
Plaid Cymru said the Lib-Lab deal was "bad news for the Welsh economy".
"There will not be, it seems, a package of emergency measures to stimulate the economy because the Lib Dems have sold their support very cheaply," a spokesman said.
The Conservatives wanted to see an increase in health spending.
Tory opposition leader Andrew RT Davies said: "What is regrettably clear is the Liberal Democrats' endorsement of Labour's savage cuts to the NHS.
"It is unfortunate that, while their Westminster colleagues protect the health budget in England, the Welsh Liberal Democrats have chosen not to prioritise the NHS in Wales."