Theresa May held good on her promise to personally challenge Donald Trump over the leaking of intelligence relating to the Manchester terror attack — but waited until after he had issued a statement condemning the leaks.

The British prime minister spoke to the U.S. president as NATO leaders gathered for their traditional "family photo" Thursday, according to a senior U.K. government official.

In a statement issued shortly before the photo at the Brussels summit, Trump had condemned the leaks as "deeply troubling" and pledged a Department of Justice investigation into the matter.

“The prime minister expressed her view that the intelligence sharing relationship with the U.S. is hugely important and valuable but obviously the intelligence needs to be kept secure,” the senior U.K. official said.

The official would not be drawn out on Trump’s reaction, insisting the president's earlier statement spoke for itself.

“These leaks have been going on for a long time and my administration will get to the bottom of this,” Trump's statement said. “I am asking the Department of Justice and other relevant agencies to launch a complete review of this matter, and if appropriate, the culprit should be prosecuted to the fullest extent of the law.”

May and British security services had expressed outrage after the name of the attacker, Salman Abedi, and pictures of the crime scene were leaked to the press, and they blamed the U.S. for the leaks.

The American government “heard the message loud and clear” from the British government and is “determined to take action,” Lewis Lukens, interim U.S. ambassador to Britain, told the BBC earlier in the day.

“These leaks were reprehensible, deeply distressing, we unequivocally condemn them,” Lukens said. “The U.S. government is launching an investigation into these leaks and will take appropriate action once we identify the source of the leaks if they are in the United States.”

Lawrence Freedman, professor of war studies at King’s College London said that such leaks had happened before.

“Stuff comes out in the States quicker than it comes out here,” he said. “But this was just one thing after another when there were clearly operational issues.”

In Whitehall, officials were baffled by what may have been the motive for the leak. One former senior government official said that the leaks had come as a surprise, but that they may have a simple explanation.

“It’s very hard to see a motive for this but sometimes in cases like this, there isn’t one,” the official said. “Somebody will leak simply to show that they have the information, that they’re in the know.”

Freedman echoed this view, adding there was likely to be “a degree of showing off in all this.”

“The British are always more reticent about giving details,” he said. “There’s a much higher premium placed on operational secrecy than elsewhere.”

The leaks also appeared to have dismayed former U.K. Chancellor George Osborne. An editorial in London’s Evening Standard newspaper, which he edits, uncharacteristically praised May for her tough line on the issue, while also pointing the finger at U.S. media outlets.

“This paper, like others, knew almost immediately the name of the Manchester suicide bomber but heeded the police request not to publish it for 36 hours while they tracked down his potential accomplices. The U.S. media ignored the request, published his name and it became instantly known around the world,” the editorial said.

“Now they are publishing leaked intelligence about the on-going hunt for the network behind the murders. We do not know whether, as a result, we have lost opportunities to break that network and save lives. We need secret intelligence in the fight against terrorism — and the intelligent know we have to keep it secret.”