Plans for a £250m film and TV studio have been halted after a land court ruled a tenant farmer cannot be removed from the area earmarked for the site.

The development on the Pentland Estate in Midlothian was given planning permission by Government ministers last year and was said to be of "national importance", but the Scottish Land Court has now ruled that land from two smallholdings cannot be used for the development.

The estate earmarked for the development is owned by the Gibsone family but part of it is farmed by James Telfer.

The court decided it could not approve the "resumption" of the two smallholdings farmed by Mr Telfer and the sale could not be said to be for the good of the whole estate.

In his ruling, Lord Minginish said: "Resumption followed by a sale of the whole estate could not be for the good of the estate because no estate would remain in the hands of the landlords.

"Our decision is, therefore, that the application should be refused for want of a reasonable purpose in relation to the good of the estate."

He concluded: "We recognise that deciding the case in such a way that a project said to be of national importance does not go ahead is a serious matter.

"However this is not the only place in Scotland on which such a development can take place."

Developers said the studio would have supported hundreds of jobs.

The Gibsone family said it was "devastated" by the decision and would consider an appeal to the Court of Session.

Nick Gibsone, co-owner of the Pentland Estate, said: "We are not by any means a wealthy family and the current estate is little more than 100 acres.

"We have spent five years trying to make the best of what we own and leave a lasting legacy that would be of benefit to the many, not the few.

"We had hoped to reach an amicable agreement with the smallholding tenant, Mr Telfer, within the provisions of smallholding law, which would have resulted in substantial compensation, and this remains the case.

"We are disappointed not only for ourselves and the developers, but for Midlothian and Scotland with the loss of hundreds of potential jobs and the boost to the economy the film studio could deliver."

Scottish Green MSPs Alison Johnstone and Andy Wightman have campaigned in support of Mr Telfer and welcomed the ruling.

They said: "We welcome this decision from the Scottish Land Court. It is clear that the landlord has no lawful grounds to resume Jim Telfer's tenancy.

"Quite why the landlord, the developers and some voices within the Scottish film industry ignored the fact that a sitting tenant has legal rights that have now been upheld is for them to explain.

"It is now incumbent on industry and the Scottish Government to deliver the much-needed national film studio on a site where development would be lawful."