The Ecuadorian government has carried out a multimillion-dollar surveillance operation designed to protect and support Julian Assange during his six years of political asylum in the country’s embassy in London, according to documents seen by the Guardian.

The surveillance operation

In 2012, Ecuador’s intelligence agency hired an international security company to establish the programme for a monthly cost of $55,000 (£40,000), which was paid from a “special expenses” budget.

The documents describe how the company’s secret agents slept 100 metres (330ft) away from the embassy in a modest basement flat costing £2,800 a month, in one of the most expensive parts of London.

From a control room inside the Ecuadorian embassy, the security team oversaw Assange’s contacts.

His guests went through a security check upon arrival, handing over their passports and mobile phones. The operatives recorded each guest’s passport number and nationality, as well as the purpose of their visit, building up a comprehensive log of everyone Assange met during his stay. According to the documents, the security company sent the confidential list of Assange’s visitors to Ecuador’s government.

The logs are likely to be of interest to Robert Mueller, the special counsel investigating allegations that Russia helped Donald Trump win the 2016 US presidential election. The FBI has interviewed at least one person involved in “Operation Guest ”, which later became known as “Operation Hotel”, it is understood.

Some of Assange’s “social” visits were from famous names including Pamela Anderson and Vivienne Westwood, as well as the WikiLeaks staff member Sarah Harrison .

There were also “extraordinary reports” that included daily logs of Assange’s activities within the embassy, noting his general mood.

Activities outside the embassy were also monitored and recorded. One report included photographs of anti-Assange protesters with signs that read “We want you out of our embassy”. It was even noted when a packet of sweets was thrown on to the balcony – seemingly a present for Assange.

Inside the embassy

This level of scrutiny came after the security company installed CCTV cameras in the embassy’s lobby and a conference room, and on the balcony.

Initially, Assange slept in a narrow room next to the balcony, but he later came to take up more than one-third of the embassy’s ground-floor space and sleep in a larger back room.

Assange’s realm was home to WikiLeaks and its computers, and not covered by CCTV. It was off limits to diplomats, with access controlled by door codes.

This surveillance did not come cheap

According to documents seen by the Guardian, the Ecuadorian intelligence agency spent at least $5m on the surveillance operation.

The agency’s expense reports alarmed the Ecuadorian financial controller, who asked how more than $400,000 could have been spent in the first five months of the operation without a single receipt.

In March, the intelligence agency was shut down by Ecuador’s president, Lenín Moreno, who described Assange’s continuing presence as an “inherited problem”.

That same month, embassy staff cut off his internet access.

Ecuadorian government sources say Quito is considering a plan for where Assange might go next, making his future more uncertain than ever.