Keir Starmer hailed German help in smashing Channel boat gangs today as he hosted Friedrich Merz.
The PM and Chancellor have signed the first bilateral treaty between the countries since the Second World War.
It includes moves to close a loophole that has meant people-smuggling gangs could use Germany as a hub to store equipment without danger of prosecution.
Home Secretary Yvette Cooper originally secured agreement that smuggling of migrants to the UK would be made a criminal offence in December.
However, the terms had to be renegotiated following a change in government.
After signing the document at the V&A Museum in London, Sir Keir said it would be known as the Kensington Treaty.

Keir Starmer hailed German help in smashing Channel boat gangs today as he hosted Freidrich Merz

The PM and Chancellor have signed the first bilateral treaty between the countries since the Second World War

The deal includes moves to close a loophole that has meant people-smuggling gangs could use Germany as a hub to store equipment without danger of prosecution
He told Mr Merz: ‘It’s a privilege to have you here today, particularly to sign this Kensington Treaty, which is a very special treaty, because it’s the first of its kind ever, if you can believe it, between our two countries.’
Sir Keir described it as ‘evidence of the closeness of our relationship as it stands today’ as well as a ‘statement of intent, a statement of our ambition to work ever more closely together’.
The agreement was also signed by Foreign Secretary David Lammy and his German counterpart Johann Wadephul.
Mr Merz said he had been ‘surprised’ to learn it was the first UK-Germany treaty since the Second World War.
He said: ‘We had you in the European Union and we thought that was enough, but we are now learning that it’s not enough so we have to do more on that.’
Asked if Sir Keir was frustrated by the slow German response to the migration crisis, Downing Street said: ‘We’ve always been clear that this is an international issue that requires international solutions.
‘And over the last year, you’ve seen the Prime Minister working tirelessly to reset relationships across Europe, and you’ve seen a number of examples of the progress of that, not least with the French last week.
‘This is a significant step that will give law enforcement and prosecutors the tools they need to address this scandal of small boats which are destined to cross the Channel being stored and concealed in Germany.
‘And it will ensure that those who feed this illegal trade have nowhere to hide.’
Under the deal, Germany has agreed to allow some arriving UK airline passengers to use passport e-gates by the end of August.
However, it will initially only be available for frequent travellers.
Access for all UK nationals will be possible once Germany has completed updates to its entry systems as it introduces the EU’s long-delayed Entry/Exit System (EES).
Since Brexit, UK travellers arriving at EU airports have generally been forced to queue for manned desks to have their passports stamped, rather than use automated gates with facial recognition technology.

After signing the document at the V&A Museum in London , Sir Keir said it would be known as the Kensington Treaty
This has led to many passengers facing long queues, particularly during peak periods.
The issue has been described as one of the most visible impacts of the UK’s withdrawal from the EU.
The UK-EU summit in May agreed there is no legal barrier to UK citizens using EU e-gates.
The Cabinet Office said since then, e-gate access for UK travellers has increased in Bulgaria, the Czech Republic and Portugal.