LONDON—The U.K. must strengthen intelligence-sharing with other European countries even after it leaves the European Union, said the head of Britain’s domestic intelligence agency, citing the continued threat of Islamic terror plots both on the Continent and in the U.K.

Speaking in Berlin, Andrew Parker said improved European security cooperation post-Brexit was necessary for foiling Islamic State plots and countering Russia’s attempts to undermine Western democracies.

“We must not risk the loss of mutual capability or weakening of collective effort across Europe,” Mr. Parker said. “I don’t do politics, but it is of course political arrangements, laws and treaties that permit or constrain what we can do together as agencies, protecting our countries and Europe.”

His comments underscore concern about whether Brexit, expected in March 2019, will disrupt security cooperation between the U.K. and other European countries. The U.K. and the EU are negotiating a deal that will shape future security and foreign policy arrangements, including information sharing and defense cooperation.

Mr. Parker said security cooperation in Europe takes strength from existing EU systems, arrangements and databases. He urged politicians to negotiate a security agreement that would allow intelligence agents to build on these arrangements to keep pace with the shifting nature of threats.