The US plotted to kidnap and possibly kill Julian Assange as he hid out at the Ecuadorian embassy in London — aiming to make it look like an accident, the WikiLeaks founder’s lawyer claimed at his extradition hearing this week.

American spies teamed up with UC Global, a Spanish company contracted by Ecuador to provide security at the embassy, to help plant “intrusive and sophisticated” secret surveillance of Assange, his attorney stated without evidence at the London hearing Monday, according to reports.

Assange was even filmed meeting with his legal team — and got so desperate about constant surveillance that he started sleeping in a tent inside his bedroom, the Telegraph reported.

It was part of an alleged plot that contemplated a sinister ending for the hacker accused of putting lives at risk with his massive dump of top-secret US documents and diplomatic cables, the court was told.

“There were conversations about whether there should be more extreme measures contemplated, such as kidnapping or poisoning Julian Assange in the embassy,” Assange’s attorney, Edward Fitzgerald, told the court, according to the Daily Mail.

US Global’s owner, David Morales, was exposed by a mysterious Iberian whistleblower known only as “Witness Two,” the report says.

Witness Two revealed that Morales “said the Americans were desperate and had even suggested more extreme measures could be applied against the guest to put an end to the situation,” Fitzgerald told the court, the Mail said.

Morales was actively working with “the dark side — in other words, US intelligence agencies,” Fitzgerald claimed, according to the report.

It was suggested that the embassy door could be left open to make a kidnapping look like it could have been “an accident,” Assange’s attorney claimed.

Assange initially entered the embassy in 2012 to avoid extradition to Sweden over sex offense allegations, which were eventually dropped.

He remained there after being indicted in the US on 18 charges over the publication of hundreds of thousands of classified documents, which his legal team says could see him sentenced to 175 years in prison.

Ecuador finally kicked him out of the embassy last April and Assange was immediately arrested by British police ready for the extradition hearing that finally started Monday.

Assange watched the proceedings from the courtroom dock, brought there from Belmarsh Prison next door.

The hearing will be adjourned at the end of the week and continue with three weeks of evidence scheduled for May. A decision on the case is not expected for months.