Scotland will host a major counter-terror exercise later this year, Theresa May has announced.

The drill will test the responses of police forces and other agencies in the event of a terror attack.

The Prime Minister said that national security was a "top priority".

“Training operations such as this one play a significant part in making sure police forces and other response agencies are able to fully draw on the latest intelligence and resources from the UK's security forces to protect against terrorism anywhere on our soil," she added.

“As the second largest force in the country, Police Scotland are a key player in our fight against terrorism.

"I’m grateful to them for the exceptional work they have been delivering so far to prepare for this very important counter-terrorism exercise.”

She made the announcement as she met officers from Police Scotland in the wake of last week’s terror attack on Westminster.

The training exercise will bring together police forces, the security services, the Armed Forces, UK Government departments and the devolved administrations.

The lessons learnt from the operation will help strengthen the response to a terrorist attack on UK soil, No 10 said.

The exercise, which will take place in October, will also involve areas in the north of England.

Downing Street said that the event would be part of "routine" testing of the UK's responses.

The announcement was made hours before Mrs May is due to meet the First Minister Nicola Sturgeon.

The two leaders are due to discuss Mrs May's plans to file divorce papers with the European Union, by triggering Article 50 of the Lisbon Treaty, on Wednesday.

The SNP leader has called for the power to hold a second independence referendum.

But Mrs May has said that now is "not the time" for another vote.

In a speech she suggested that Scotland could be given more powers, saying that at the the heart of her Brexit plan was "one over-arching goal - to build a more united nation.

"In Scotland, Wales and Northern Ireland that means fully respecting and, indeed, strengthening the devolution settlements, but never allowing our Union to become looser and weaker."

But No 10 made clear that the Prime Minister had not shifted her position on independence.

Downing Street said that while Brexit negotiations were going on "that is not the time for a referendum".

No 10 said that Mrs May planned to use the meeting to point "to the significant areas where there is agreement on what we wish to secure from the Article 50 process.

"She has been clear the Government has been listening throughout and it will be a case of setting out how we can all move forward together to get the best deal for the whole of the UK.

"Areas where it's already clear there is significant common ground - frictionless trade with the EU, agreement that workers' rights can't be eroded, continuing operation with EU member states on security issues."

Asked if the Scottish Government could have any direct input into Brexit negotiations, Downing Street said that the Prime Minister had been clear that she would "remain engaged with all the devolved administrations closely throughout this entire process".

The Scottish Government has accused Conservative ministers of a "lack of engagement" with Scottish Government proposals to preserve Scotland's place in Europe.

Ms Sturgeon has set out what she insists are "compromise" proposals to keep Scotland in the single market.

A spokeswoman for Michael Russell, Scotland's Brexit minister, said: "We understand the UK Government wishes to discuss Article 50.

"Given we are just days from the formal process of Brexit being triggered there have, as yet, been no discussion with the Scottish Government over what will be in the letter triggering departure from the EU.

"There has been no discussion over how Scotland's interests will be represented, what role the Scottish Government will play in negotiations, nor which powers the Tories intend to take for Westminster and which powers will rightly be determined by Holyrood.

"Most worryingly, there has been no discussion over how the UK Government intends to manage the financial impacts of Brexit and the consequences for jobs and the economy in Scotland.

"There are clearly a lot of areas where we hope the Prime Minister intends to provide answers."

She added: "Given the lack of engagement and the failure of the UK Government to seek an agreed approach or to support staying in the single market, which are at the heart of our compromise proposals, it is appearing that this is another area where a Tory prime minister intends to simply dictate the rules and expect people in Scotland to go along with it."

Scotland's Justice Secretary Michael Matheson said: "Such exercises are a key component of how we can ensure we are in the best possible position to respond to a terrorist attack. Last week's events in London are a sharp reminder of the need for preparedness.

"Our priority must be keeping people safe, wherever they live. Exercise Border Reiver later this year is an example of the co-operation which will always take place, and test the ability of the police, the ambulance and fire and rescue services, and our respective Governments to work together to resolve the most challenging situations.

"The Scottish Government is fully committed to supporting the development and delivery of this exercise."