The warning comes as Theresa May prepares to start withdrawal from the EU.

The most senior British EU official has spoken out to warn of the need for strong security cooperation in Europe, just days before Theresa May triggers Brexit. Writing exclusively for The Independent, EU commissioner Sir Julian King said it was vital for nations to work closely to combat international cyber attacks, terrorists and hostile states and “be prepared for whatever the future holds”. The European security chief’s words comes less than 24 hours after the Queen signed off legislation handing Ms May the power to begin pulling Britain out of the EU, potentially risking future security cooperation.

Intelligence sharing will play a central role in negotiations once Article 50 talks are launched in March, with Ms May having specifically highlighted the area in her landmark Lancaster House speech on Brexit. Politicians in London have warned how the UK stands to lose international influence and ground in the fight against terror if deep security links with Europe are lost, meanwhile there have been implicit indications that Britain may use its highly valued intelligence services as a bargaining chip in talks. In his article, security commissioner Sir Julian describes how the world is facing a “new and darker phase” in its relationship with technology, but adds that countries must work “collectively” to tackle the threats confronting them.

He wrote: “Working with colleagues across the European Commission, we are determined to implement a plan for reducing our vulnerability to cyber threats by increasing our resilience to attacks, reinforcing security by design, stepping up the fight against cyber crime, investing in cyber security … and strengthening international cooperation.

“The interconnected world offers many opportunities for citizens, governments and public and private enterprises to make a positive contribution to society. But it also offers unprecedented opportunities to criminals, terrorists, and hostile states.

“We must be better prepared for whatever the future holds.”

Sir Julian highlighted Europol’s work exposing how sophisticated crime syndicates exploit online trade in illicit goods, adding that “online fraud is now the most common crime in the UK”. He also promotes a public-private partnership launched last year, expected to trigger €1.8bn (£1.6bn) of cyber-security investment by 2020. Last month, Sir Julian gave evidence to MPs in which he hailed the “material contribution to the UK’s security” from the EU’s hard-earned cross-border security agreements.

The commissioner argued there would be “legal constraints and some practical constraints” for the UK in trying to replicate Europol, adding: “However good you are at this threat – and everybody recognises that the UK and its agencies in this field are very good – you are more effective if you are working with your partners.”

On Thursday, the Queen gave royal assent to the Article 50 bill giving Ms May permission to trigger a two-year countdown during which a deal on future relations must be sealed. With many doubting that a divorce agreement and future trade arrangements can be locked in such a short schedule, British politicians have raised concerns about the impact on security cooperation. A House of Lords report published in December said arrangements currently in place to maintain working between the UK and other EU member states are “mission-critical” for Britain’s law enforcement agencies.

Even Ms May, when she was Home Security in 2014, underlined the importance of cooperating with Europe saying a failure to do so “would risk harmful individuals walking free and escaping justice, and would seriously harm the capability of our law enforcement agencies to keep the public safe”.

Brexit Secretary David Davis has identified maintaining the strong security cooperation as key objectives in the forthcoming negotiations. In her speech in January at Lancaster House, Ms May also signalled a desire to continue working on security with Europe.

She said: “Our intelligence capabilities – unique in Europe – have already saved countless lives in very many terrorist plots that have been thwarted in countries across our continent.

“After Brexit, Britain wants to be a good friend and neighbour in every way, and that includes defending the safety and security of all of our citizens.”

But she juxtaposed those words, just a few sentences later, with a claim that some in Europe want a “punitive deal that punishes Britain” and adding that such a move would be “an act of calamitous self-harm for the countries of Europe”.