Dairy farmers and processing firms have struck a deal “in principle” to end the bitter stalemate over milk prices.
The two sides met face-to-face at the Royal Welsh show in Powys today after a tense past few days, which culminated in several dairy factories being blockaded.
Several agricultural unions say their members are angry at being paid less for the milk they produce by big supermarkets - who aim to keep the cost of dairy products for its customers as low as possible.
Following hours of talks, both sides have agreed to sign up to a new voluntary code of practice.
It means firms buying milk, like big supermarkets, would give a "sensible" notice period when changing their prices - so farmers would have enough time to opt out of any deals.
Government officials say they could still bring in legislation at a later date if the code failed to work - but admitted ministers would still not be able to dictate prices.
National Farming Union (NFU) president Peter Kendall said while the announcement gave some hope for the long term it did not solve the issues farmers faced on a daily basis.
He said: "This agreement will give us the architecture we need to make sure that we don't end up with the same dysfunctional markets that are responsible for the dairy crisis we have today.
"The farming community is more united than ever before and the strength of feeling on this dairy issue is increasing and not decreasing.
"We will spend the rest of this month collectively throwing 100% of our efforts into reversing the price cuts from earlier this year and rescinding the ones on the horizon on August 1."
Farmers say the issue of milk prices has been a major bone of contention for them for many years.
Brian Walters is the vice president of the Farmers' Union of Wales (FUW) as well as a dairy farmer in Carmarthenshire, west Wales.
He said: "Back in 1994, the price that we would get for a pint of milk was around 25p per litre.
"Since then our costs, including fuel prices, have risen dramatically but the price which we receive has not gone up in line with those rises.
"Many processors and supermarkets are paying dairy farmers less - to keep the price of milk artificially low for shoppers.
"In the short term that sounds like a great deal for the consumer.
"But over time it has meant those in the dairy sector are incurring losses.
"It has had a major effect on us and has resulted in the number of dairy farmers halving within the past 13 years."
Farmers' anger appeared to have reached a tipping point on Sunday, when 2,000 of them blockaded plants near Bridgwater, Somerset, Droitwich Spa in Worcestershire and Market Drayton in Shropshire.
Officials from the UK Government's Department for Environment, Food and Rural Affairs (Defra) hope the creation of a new code would help resolve the situation.
A spokesman said: "The finer details of the code will now be finalised by all parties by the end of August.
"The code means in future, contracts between farmers and dairy processors will be freely negotiated, fairer and more transparent."
As part of the agreement, individual farmers can negotiate contracts - covering issues such as pricing and notice periods.
Farmers will also have the ability to leave contracts "more easily" if they are unhappy with the price they receive.
UK farming minister Jim Paice welcomed the commitment all sides had shown to strike a deal.
"The Government will continue to work with all parts of the industry to secure its long-term future, including promoting farmers working together in producer organisations," he said.