Plans to protect the wages of more than 13,000 farm workers in Wales have been blocked by the UK government.
AMs passed a law giving Welsh ministers the power to set pay after the Agricultural Wages Board (AWB) serving England and Wales was abolished.
But UK Attorney General Dominic Grieve has blocked the Agricultural Sector (Wales) Bill saying it was not within the assembly's competence.
The Supreme Court will now rule on whether the bill can become law or not.
AMs voted in favour of a bill on agricultural wages at the very end of the summer term in July, following an emergency three week law making procedure.
The board, abolished in June after 65 years, oversaw six pay grades relating to workers skills, qualifications, experience and their level of responsibility.
All the pay levels were set higher than the statutory minimum wage, currently £6.31 for workers aged 21 and over.
The Welsh government opposed abolition of the board but was told by Whitehall it was not a devolved matter since it was mainly about non-devolved employment issues rather than agriculture.
Scotland and Northern Ireland have their own wages board.
Rural Affairs Minister Alun Davies said the bill would help ensure a prosperous future for Welsh agriculture.
However, the Attorney General has now written to the assembly raising objections.
"I am not convinced that the Bill is within the National Assembly's competence and I have therefore decided to refer it to the Supreme Court," he wrote.
"I hope that this reference will give us clarity in respect of important questions about the breadth of the National Assembly's competence."
The Welsh government defended its bill saying it would "encourage new entrants into the agricultural industry and will help the sector to enhance and retain important skills in order to ensure the future prosperity of the sector".
A spokesperson added: "We continue to maintain that the Bill is within the legislative competence of the Assembly.
"We have had confirmation that the UK Government intends to seek to continue the agricultural wages regime in Wales beyond 1 October until the Supreme Court makes its ruling, which we welcome."
The Conservatives' shadow rural affairs minister Antoinette Sandbach said: "The Welsh Labour Government was warned numerous times that they may not have the power to interfere in agricultural wages, so this referral to the Supreme Court is not a surprise.
"Labour Ministers rushed this bill through the Assembly using the emergency procedure to prevent proper engagement with and scrutiny by Assembly Members, farming unions and the agricultural industry, resulting in sloppy legislation and doubts over competence."
But Plaid Cymru said it was "disappointing" that the bill had been blocked, saying it came on the day that the Silk Commission reported that the people of Wales trusted the assembly more than Westminster.
A spokesperson said: "Plaid Cymru hopes that these important safeguards for agricultural workers are found to be within the National Assembly's powers.
"If not then it is a further example that Wales must have more power to look after our workers and our affairs, and shows why a new Government of Wales Act is needed."
Abolition of the AWB divided farming unions, with the Farmers' Union of Wales (FUW) saying the board was "vital" while the National Farmers' Union (NFU) thought it "outdated and unnecessary".
The first bill passed by the assembly - relating to local government byelaws - was also blocked, but the Supreme Court found that it was within the assembly's powers and it has now become law.
It is thought it could be several months before the Supreme Court is able to consider the matter.