Downing Street attempted to withhold sensitive intelligence from Boris Johnson when he became foreign secretary, the BBC has learned.
This caused concern in the intelligence services, since the foreign secretary authorises sensitive operations.
But sources close to Mr Johnson say there was no row about being denied access and he saw everything he needed to see as foreign secretary.
A Number 10 spokesperson said it did not comment on intelligence matters.
On 20 October 2016, Mr Johnson paid his first visit as foreign secretary to MI6’s headquarters at Vauxhall Cross in London.
After he was shown around by Alex Younger, the chief of MI6, Mr Johnson addressed staff and held an informal question and answer session.
“I was delighted to welcome the foreign secretary to our Vauxhall Cross headquarters so he could see first-hand the kind of work that MI6 does,” the chief, known as “C”, said at the time.
Mr Johnson was effusive in his praise.
“Even from my relatively short period as foreign secretary I can testify to how vital the work they do is,” he said.
But behind the scenes a row had been taking place about whether Mr Johnson would have access to all the intelligence produced by the UK’s spies, according to a number of sources, who spoke anonymously because of the sensitivity of the subject.
The prime minister has overall responsibility for intelligence and security matters, but day-to-day ministerial responsibility and accountability for MI6 and GCHQ sit with the foreign secretary.
However, Number 10 wanted Mr Johnson to not be shown a category of sensitive secret intelligence after he was appointed in July 2016, according to multiple sources with direct knowledge of events, none of whom are involved in the leadership campaign or politics.
One person said Mr Johnson was aware of the decision at the time and was “very unhappy”.
However, sources close to Mr Johnson say there was no row about being denied access and that he saw everything he needed to see from his first day as foreign secretary.
One individual aware of events at the time attributed the attempt primarily to “control freakery” by Number 10, rather than a lack of trust in Mr Johnson’s ability to keep secrets.
Others have told the BBC it was a “combination of everyone’s faults”, citing nervousness over Mr Johnson’s lack of discipline and hostility between him and Theresa May.
A spokesperson for Number 10 said it did not comment on intelligence matters, although sources said all decisions around access were taken in the appropriate way and they were confident Mr Johnson was able to “see what he needed to see”.
But they did not clarify whether that meant all intelligence.
The move may also have reflected an institutional shift in which Number 10 has increasingly taken central control of national security, including intelligence.
The prime minister and security officials around her have the ability to designate who will be read in to certain “compartments” of the most classified intelligence.
Lists of who receives intelligence are occasionally “pruned” to ensure security is maintained by liming the numbers with access.
But one individual with knowledge of events says that while they were aware of junior Foreign Office ministers previously not being shown certain specific streams of intelligence, it would be “unprecedented” if this was to apply to the foreign secretary.
It is not clear if Jeremy Hunt, on being appointed foreign secretary in July 2018, was provided complete access and a Foreign Office spokesperson said it did not comment on intelligence matters.
Senior intelligence officials were concerned by the decision at the time, the BBC understands.
One source says they took legal advice as to whether they could sustain a position in which the foreign secretary was responsible for operations for which he was not shown the intelligence “product”.
This is because the foreign secretary signs authorisations for intelligence-gathering operations.
They do this by judging the proportionality of an operation based on balancing the risks and rewards.
But this, it was feared, would be hard to do without having access to the intelligence that was produced.
In the end a compromise was agreed in which Mr Johnson would technically have the right to see intelligence although it is not clear if he was shown all intelligence as a matter of course, one source said.
If he wins the Conservative Party leadership contest, Mr Johnson will become prime minister and take on overall responsibility for intelligence and security matters from Mrs May.