THERESA May has set herself on a collision course with Nicola Sturgeon by indicating she will rewrite the devolution settlement after Brexit.

The Prime Minister confirmed the UK Government wanted to hold onto some powers in devolved areas which will be repatriated from Brussels instead of transferring them to Holyrood.

Ms Sturgeon said this week that all such powers must go to Edinburgh after Brexit, and anything less would be an attack on the “very foundations” of the Scottish Parliament.

But in a speech to the Scottish Conservative conference, the Prime Minister suggested the 1998 devolution settlement was now out of date because of Brexit.

She said the aim now was to “ensure that the right powers sit at the right level” to “avoid any unintended consequences for the integrity” of a post-Brexit UK.

UK-wide positions on aspects of agriculture, fisheries and the environment were preferable “to strike the best possible possible trade deals internationally”, she said.

In a half-hour speech to Tory activists in Glasgow, the Prime Minister also attacked the SNP’s “obsession” with independence and made a lengthy defence of the Union, saying: “We cannot allow our United Kingdom to drift apart.”

Under the 1998 Scotland Act underpinning devolution, powers not specifically reserved to Westminster are automatically devolved to Holyrood.

Ms Sturgeon said on Tuesday that altering that arrangement would undermine devolution and claimed the Tories wanted to exploit Brexit to “strip” Holyrood of its rightful powers, highlighting agriculture and fishing.

However Mrs May indicated the principle would no longer apply after Brexit, and although Holyrood would get more powers after 2019, it would not get everything Ms Sturgeon wants.

She said: “The devolution settlements were designed in 1998, without any thought of a potential Brexit.

“In areas like agriculture, fisheries, and the environment, the devolution settlements in effect devolved to the legislatures in Edinburgh, Cardiff and Belfast the power to implement EU directives in these areas, within a common EU framework.

“As we bring powers and control back to the United Kingdom, we must ensure that right powers sit at the right level to ensure our United Kingdom can operate effectively and in the interests of all of its citizens, including people in Scotland.

“We must also ensure that the UK which emerges from the EU is able to strike the best possible trade deals internationally.

“In short, we must avoid any unintended consequences for the coherence and integrity of a devolved United Kingdom as a result of our leaving the EU.”

Mrs May repeated her pledge that no decisions “currently” taken at Holyrood would be removed, but made it clear that she did not accept the SNP’s position that all powers in devolved areas rightfully belonged with MSPs after Brexit.

Scottish Secretary David Mundell last month said Brexit might require a new Scotland Act.

Mrs May went on: “Our aim will be to achieve the most effective arrangements to maintain and strengthen the United Kingdom, while also respecting the devolution settlements, and we will work constructively with the devolved administrations on that basis.”

She said she wanted Brexit to benefit the UK as a whole, and said her government had adopted a principle of “collective responsibility” to help bind the devolved nations together.

She said it would “unite all layers of government to work positively together”, adding: “While fully respecting, and indeed strengthening, the devolution settlements and the devolved administrations across the UK, we must unashamedly assert this fundamental responsibility.

“Scotland stands to benefit from this new approach. In those areas where the UK Government holds the policy levers, we will use them wisely to the benefit of Scottish firms and workers.

“Where the Scottish Government hold the levers, in areas like skills and infrastructure, we will seek to work with them to ensure the best outcomes for Scotland.

“At all times, we will seek to strengthen and enhance the ties that bind us together.”

She ended by urging around 500 delegates at the Scottish Event Campus to make a positive case for the “enduring” Union based on the principles of solidarity, unity and family.

She said: “We are four nations, but at heart we are one people. That solidarity is the essence of our United Kingdom and is the surest safeguard of its future.

“Let us live up to that high ideal and let us never stop making loudly and clearly, the positive optimistic and passionate case for our precious union of nations and people.”

Former SNP First Minister Alex Salmond called Mrs May’s speech a “power grab”.

He said: “She's actually proposing that if Brexit goes ahead the powers that should come back to Scotland on fishing, farming and a range other issues – she's going to retain them at Westminster, because she likes the look of the Scottish economic zone.

“That's a fundamental attack on the very principle and foundation in statute of the Scottish Parliament of 1999, which said specifically that anything that wasn't reserved to Westminster should be run in Scotland. This is Prime Minister who is attacking the very foundations of the Scottish Parliament and she'll do it to her cost.”

Scottish Labour leader Kezia Dugdale said: “The Prime Minister has undermined the Union at every turn since entering Downing Street.

“She may claim the Union is ‘precious’ to her, but the Prime Minister is the person responsible for putting the Union at risk once again.

“She has allowed Nicola Sturgeon to focus on the constitution rather than fix the problems her government has created in our NHS, schools and communities.”

Scottish Liberal Democrat leader Willie Rennie MSP said: “The Conservatives and SNP are the terrible twins with each behaving as badly as the other.

“Both sow the politics of division, each use the other to make their arguments, none have a real focus on the needs of our security, economy and environment.”