First Minister Nicola Sturgeon MSP addresses the annual general meeting of the National Farmers Union in Scotland.

I want to start by congratulating you, Andrew (McCornick, President of National Farmers Union Scotland) and all of the new office bearers who have just been elected. You are taking up your positions during one of the most important periods in the history of the National Farmers Union in Scotland (NFUS). Your job won't always be easy, but it will be fascinating and hugely worthwhile. Fergus (Ewing, Secretary for the Rural Economy and Connectivity) and I look forward to working with you over the coming months and years.

When the National Farmers Union in Scotland was established in 1913 one of the most important speeches was made by William Donald, the Chair of the meeting.

He argued that farmers 'were the most important, the greatest, and the oldest industry in the country, and yet the worst organised'.

In the years since then, some things have changed and others have remained the same. Largely because of NFUS, farmers are much, much better organised. For a government, that can sometimes feel like a mixed blessing – but it does, undoubtedly, benefit all of us.

However the importance of agriculture – your position as an industry which is of vital importance to Scotland – continues to this day. You remain one of the greatest and most important industries in our country. That's why the Scottish Government is absolutely committed to supporting and developing the sector.

When the Scottish Government revised our Government Economic Strategy in 2015, we prioritised inclusive growth – we want sustainable growth which benefits all sectors of society, and all parts of the country. We can't achieve that goal without strong rural communities.

That's why we work very hard and invest so heavily in supporting the rural economy. Our investment in broadband is a good example of that. In 2014, just 4% of households in the Highlands and Islands had access to superfast broadband. By the end of this year, the figure will be 85%. By the end of this parliament, it will be 100%.

We're also investing heavily in rural transport links – for example the Borders railway and the dualling of the A9. And we provide strong backing for key sectors – including tourism, food and drink and life sciences – which are crucial to the rural economy.

And so support for farming is one part of our wider vision of Scotland. We want to create a country where all towns and communities flourish. We cannot achieve that aspiration without a successful and sustainable farming sector.

Recognition of the importance of this sector is what led us to launch the national conversation on the future of Scottish agriculture, and it's why we're now developing an agriculture strategy. We want farmers and the government to agree together our key priorities for improving the sector in the years ahead.

Now, I won't pre-empt the strategy or cover every single matter which is relevant to farming in today's speech. Instead I'll cover three issues of significant long term concern – how we attract new entrants into farming; how we ensure that farming benefits fully from the success of the food and drink industry; and how we adapt to the impact of Brexit.

But I want to start with an issue of immediate and very direct relevance to most of the people in this room. Last year's problems with farm payments were unacceptable. Many of you, rightly, made that very clear to us. So did your union.

In fact farm payments has been a good example of the role NFUS can play. It has been clear in its criticism, while also being very constructive in working with us to mitigate the impact on farmers.

I want to assure all of you today that lessons have been learned. The Scottish Government has already accepted every recommendation made by Audit Scotland in relation to future payments, as part of our work to improve the system. We have also made £270 million of loans available for farmers who needed to receive their 2016 payments in January or earlier. And we expect all 2016 payments to be made by the end of June.

We understand the difficulties that late payments caused to you last year. We apologise for those difficulties. We are determined not to repeat them.

And in addition to addressing that immediate priority, we are also supporting the long term future of the agriculture sector.

A good example of that is our work to attract new entrants into farming. Doing that is vital to the long-term health of the sector. According to last year's farm census, more than a third of farm occupiers are over the age of 65; fewer than a tenth are under the age of 40.

That's why we're providing advice, mentoring and financial support for new entrants – for example through the Scottish Rural Development Programme. In total, more than 140 businesses in the last two years have benefited from funding to help new or young farmers.

We have also commissioned research on women's experiences in farming – at present, women are under-represented in the sector, so it makes sense to look at how we can change that.

And we're also looking at other ways in which the government can help. For example in recent years we've enabled new farmers to take up tenancies on land owned by Forest Enterprise Scotland. We're now trying to create further opportunities for new farmers to use publicly owned land.

Following a report on this issue last year, Henry Graham – an experienced farmer, and the chair of the Lantra training organisation in Scotland – is chairing a group which will take forward a new entrants opportunities programme. It will advise on further ways in which the public sector – as one of the biggest landowners in the country – can play a larger role in encouraging young people to take up farming.

The next issue I want to talk about is a longstanding challenge for farmers, but also a huge opportunity.

In recent years, the food and drink sector has been the fastest growing major sector in the Scottish economy. It employs over 100,000 people, and accounts for almost a third of our international exports. It's a major economic success story.

The Scottish Government has backed the industry in every way we can. But the sector's success is mainly due to the hard work of food and drink companies across Scotland – and also, crucially, the people who supply them. After all, the quality of Scottish produce – our Scotch beef, our seed potatoes, our soft fruits and much more besides – is a vital selling point.

I know that there can sometimes seem to be a disparity between that success of the food and drink sector, and the challenges that many farmers face. It's an issue we hear about regularly, and it's something I'm sure will be looked at in the agriculture strategy. It is also a major focus of the new food and drink strategy, which is being launched next month.

That strategy has been led by the food and drink industry and supported by the public sector. It will set out priorities and actions for the sector until 2030. At its heart will be action to strengthen the position of farmers in the supply chain.

All of us recognise that farming is crucial to our food and drink sector. And so the strategy will set out actions which will ultimately be good for you as farmers, will benefit consumers in Scotland and will enhance the industry's reputation and sales around the world.

The final issue I want to talk about this morning is Brexit. In my view, it presents the biggest challenge to farming in Scotland for a generation at least.

All of you will know that the Scottish Government in December published proposals on Europe. We set out how Scotland could potentially remain in the single market, even if the rest of the UK chose to leave. It's a sensible compromise solution which would respect Scotland's very clear vote to remain within the EU.

If that proves to be impossible, I've made it clear that Scotland should have the right to choose a different future for ourselves. But independence is not my starting point. I am actively seeking a compromise.

That's a summary of our broader position on Brexit. Today I want to go into a bit more detail about our key priorities for agriculture. I'll talk in particular about farm payments, tariffs, and the importance of EU workers in Scotland.

I'll take the issue of farm payments first. Payments to farmers and rural communities in Scotland under the Common Agricultural Policy (CAP) are currently worth around £500 million a year. For many farmers they make the difference between making a profit or breaking even, and becoming unsustainable.

That support needs to continue. At the moment, the UK Government has guaranteed some payments up until 2019. We believe that all payments – including for less favoured areas – should be guaranteed until the end of the current CAP payment period in 2020.

And since support for farmers will still be needed beyond 2020, there should also be a guarantee that funding will be provided beyond 2020.

We will make those points very firmly to the UK Government. And in doing so, we will also point out that Scotland gets a poor deal from the current system. To take the most obvious example, by 2019 farmers in Scotland who use land which is assessed as being 'less favourable' for agriculture – many sheep farmers, for example – will receive around 10 euros of area-based support per hectare; in England, they will receive 65 euros per hectare.

The European Union actually recognised that anomaly, and have provided an additional £190 million to the UK – specifically as a result of the low payments received in Scotland. However instead of being used to compensate farmers here in Scotland, that money was distributed across the UK. So Scottish farmers won't receive the full £190 million they are due; they will receive just over £30 million. Future support for farmers needs to address that obvious injustice.

We will also argue for change in other areas. The red meat levy is a good example. It is used by Quality Meat Scotland to promote Scotch beef, lamb and pork.

Twelve years ago, the Radcliffe Review noted that the existing levy distribution system, which is based on where animals are sent to the abattoir, rather than where they are reared, may not be in the best interests of producers.

That's an important issue here, since a large number of Scottish lambs, pigs and cattle go through English and Welsh abattoirs.

But the Radcliffe Review's findings still haven't been acted upon. As a result Quality Meat Scotland and our livestock farmers lost out on £1.5 million last year per annum, which went to the levy bodies down south.

There's a similar issue at the moment with the seafish levy – it's costing our industry £2 million a year.

It means that money taken from Scottish producers, which should be used to market Scottish goods, is instead being used to promote red meat and seafish from elsewhere on these islands. It's a ridiculous situation. The Scottish Government – like NFU Scotland – will argue for change.

So our position on farm payments is that support for farmers needs to be protected, and the move to a new system should also be used to rectify some long-standing anomalies.

The final point I want to make on this, is that as we argue that case, we will also continue to ensure that Scotland's own rules for farm support are proportionate and effective.

We know that farmers have requested changes to some of the rules surrounding greening payments. Those payments are currently worth around 150 million euros a year in Scotland.

There's an important balance to be struck here. We hugely appreciate the key role farmers and crofters play as custodians of our land. I want to thank you for that, and for all the work you already do to help protect this most fundamental, natural asset. Many of you undertake key measures – outwith the EU greening requirements – that benefit our environment, and help us meet our climate change targets.

That's crucial, because farming and food production in Scotland needs to be environmentally sustainable – to protects our natural assets and helps us tackle climate change. And it also needs to be economically productive and profitable.

So we have to ensure that payments encourage sustainable farming, protect the natural environment, and help us to meet our climate change commitments. That's in the long term interests of all of us. As all of you know, a healthy environment is good for farming – it can have important benefits for soil quality, for example.

However at the same time, we also need to ensure that the rules for farmers achieve the benefits we all seek, as effectively and efficiently as possible.

I can confirm today that Professor Russell Griggs will chair a group to review the Scottish Government's approach to greening. The group's recommendations will play an important part in ensuring that support for farmers benefits the agriculture industry, and also protects and enhances the environment.

The second issue around Brexit that I want to talk about is free trade.

As a member of the EU, Scottish exports – including our agricultural exports – aren't subject to tariffs when we sell to other member states. That's a huge benefit for our exporters. Brexit puts it at risk.

Quality Meat Scotland published a paper yesterday which highlighted some of the implications for cattle, sheep and pig farmers. Those sectors make up 40% of Scottish farm output.

Four out of five of our international exports of beef and lamb currently go to EU nations. However Quality Meat Scotland point out that there is a genuine possibility of a tariff on meat exports to the EU – potentially of significantly more than 50% – or of a tariff rate quota. A quota would, in practice, make it incredibly difficult to increase Scottish exports beyond the limits of the quota.

Either of those options would be deeply damaging to Scottish producers. And of course, any tariffs on EU products coming into Scotland would also make goods more expensive for Scottish households. So maintaining tariff-free trade with EU nations is a priority for the Scottish Government.

Now, I mentioned earlier that Scotland has proposed that we retain single market membership, even if the UK chooses to leave. That's something which would help most parts of our economy in mitigating the impact of Brexit.

But as most of you know, single market membership on its own won't be sufficient to protect the farming sector. Membership of the European Economic Area covers most parts of the economy, but not agriculture.

That's why the plan we published in December makes it clear that we want the UK Government to negotiate for tariff-free access to the single market for products such as beef, lamb, cereals and vegetables. It's the best way of ensuring that quality Scottish produce can compete in the European market. And it's the most beneficial arrangement for producers and consumers, both here and in Europe.

Of course, now more than ever, it's important that we look to the future and continue expanding the market for our quality produce. That's why we will support additional work this year to promote our quality meat sector, at trade fairs in Asia and North America. This will build on the work we've already done to boost our dairy brand, and it will help send the message that Scotland is open for business.

The third challenge posed by Brexit – along with support payments and tariffs – is freedom of movement.

People from the EU who choose to live and work in Scotland make a massive contribution to our culture, our economy and our society. Many of you will know from your own experience that they also have a big impact on the agricultural sector – whether they are picking soft fruit, working in abattoirs or researching in laboratories.

And so we are determined to reassure EU citizens who are already living in Scotland that they are welcome here. And we want to retain freedom of movement so that Scotland can continue to benefit in the future. In everything we do in relation to Brexit, we want Scotland to remain an open, welcoming and diverse country. It's good for our society and it's good for our economy.

And the final point I want to make in all of this is that it's hugely important that Scotland's needs are recognised and our priorities are met. There's a democratic principle here – the UK government needs to acknowledge that a significant majority of people in Scotland opted to stay in the EU.

But there's also an important practical point. Agriculture is a more important part of Scotland's economy than it is of the UK's. Because of our landscape and our climate, there's also a different pattern to agriculture here – 85% of Scotland's farmland is eligible for payments that recognise it as 'less favourable' land. The role of farming in making rural and remote communities viable is even more important in Scotland than elsewhere.

And so it's important for the agriculture sector that Scotland has a strong say in our negotiations with the EU. It's the best way of ensuring that the settlement which is reached meets your needs.

In addition, it's also vital that any powers which are transferred from the European Union, at the time of Brexit, must go to the Scottish Parliament rather than to Westminster. It is the best way of ensuring that future decisions on farming reflect Scotland's distinct priorities.

In all of this, my commitment to you is that the Scottish Government will do everything we can to ensure that the needs of Scottish farmers are recognised.

And at the same time as we argue for your interests on Brexit, we will also work with you on the day to day actions which are needed to make the sector as sustainable and efficient as possible – encouraging new entrants; recognising farming's place at the heart of our food and drink industry's success; and developing a sustainable strategy for the future.

Agriculture in Scotland has huge strengths – we benefit above all from an international reputation for high quality products, and from the dedication and expertise of our farmers. We are determined to use those strengths, to ensure a successful future. We know that by doing so, we can create benefits for the farming sector, the rural economy, and indeed, the whole of Scotland.

As we do that, the role of NFU Scotland – as a champion for Scottish farmers, and as a constructive but critical partner of Government – will be more important than ever. Myself, Fergus, and all of the government, look forward to working with you in the months and years ahead.