Japan warned Prime Minister Theresa May on Thursday that its companies would have to leave Britain if trade barriers after Brexit made them unprofitable.

Japanese firms have spent more than £40 billion ($56 billion) in Britain, encouraged by successive governments since Margaret Thatcher promised them a business-friendly base from which to trade across the continent.

But after May and several of her top ministers met bosses from 19 Japanese businesses — including Nissan Motor Co., SoftBank Group Corp. and bank Nomura Holdings Inc. — Japan's ambassador to Britain issued an unusually blunt warning on the risks of trade barriers.