A new agreement has been secured between NSW and the federal government on the future of the Murray-Darling Basin.

A “historic” deal has been signed between NSW and the Commonwealth, securing $80 million for water infrastructure projects along the Murray-Darling Basin.

Prime Minister Tony Abbott and NSW Premier Barry O’Farrell penned the agreement in Canberra on Thursday.

The extra funds, which will be made available over the next eight years, will go towards water management projects and water resource plans.

The NSW government and previous federal Labor government were in negotiations over the future of the Murray-Darling Basin but were locked in an impasse over funding and water buybacks.

The new agreement sets a cap on water purchases at 1500 gigalitres.

Mr Abbott says the agreement with NSW brings all jurisdictions together to implement the “historic” Murray-Darling Basin Plan.

Victoria, South Australia and the ACT have also reaffirmed their commitment to the plan, the prime minister says.

“The fundamental priorities are to ensure the Murray-Darling’s food and fibre industries remain vibrant and sustainable, and that the river system on which they rely is restored to good health for the long term,” he said in a statement.

As part of the agreement, the states have assured the federal government the money won’t be “counteracted or undone”, Mr Abbott said.

Deputy NSW Premier Andrew Stoner said the agreement was good news for farmers, irrigators and the environment.

“It’s important as we face drought conditions across many parts of the state,” he said in a statement.

“One of the challenges I’m very keen to address, in addition to getting rural and regional communities through this drought, is to prepare them for the next one as well.”

To help regional communities adjust to the changes brought about by the Basin Plan, the federal government will also give $32.5 million to NSW, $25 million to Victoria, $25 million to South Australia and $15 million to Queensland from the Regional Economic Diversification Program.

NSW Farmers spokeswoman Helen Dalton said she was pleased that NSW “stood its ground” until a “sensible” limit on buybacks was reached.

“Irrigators and water users need certainty and the signing of this agreement today will deliver some of that for them,” she said in a statement.