Julian Assange appeared in court to give evidence over allegations he was spied upon while living at the Ecuadorian Embassy in London.

Footage from embassy CCTV cameras and documents, including private legal papers and a medical record, were allegedly offered to Spanish police during an undercover operation.

A Spanish security firm has been accused over the hack.

The case was launched in Madrid earlier this year.

Julian Assange - In pictures 23 show all Julian Assange - In pictures 1/23 2019 Julian Assange made a defiant gesture with his fist as he arrived at court AFP/Getty Images 2/23 2019 Julian Assange on his arrival at Westminster Magistrates court on April 11 Jack Taylor/Getty Images 3/23 2017 Julian Assange puts his fist in the air as he steps out to speak to the media from the balcony of the Embassy Of Ecuador Getty Images 4/23 2012 Protesters gather outside the Ecuadorian Embassy, where Julian Assange, founder of Wikileaks is staying Getty Images 5/23 2012 Masked supporters of Julian Assange outside the Embassy of Ecuador in Knightsbridge Dominic Lipinski/PA 6/23 2010 Photographers hold cameras to the windows of a Serco prison van believed to be carrying WikiLeaks founder Julian Assange Reuters 7/23 2016 ulian Assange's cat, is adorned with a tie and collar inside the window of the Ecuadorian Embassy PA 8/23 2016 Pamela Anderson delivers lunch to Julian Assange at Embassy of Ecuador Getty Images 9/23 2010 Wikileaks founder Julian Assange is pictured through the heavily tinted windows of a police vehicle as he arrives at Westminster magistrates court in London AFP/Getty Images 10/23 2010 Jemima Kahn leaves the City of Westminster Magistrates Court after offering to stand as surety for Julian Assange Getty Images 11/23 2010 Julian Assange of the WikiLeaks website speaks to reporters in front of a Don McCullin Vietnam war photograph at The Front Line Club in London Getty Images 12/23 2010 Wikileaks founder Julian Assange gestures inside a prison van with red windows as he arrives at the Royal Courts of Justice Getty Images 13/23 2011 WikiLeaks website founder Julian Assange arrives at The High Court Getty Images 14/23 2011 Julian Assange, founder of the WikiLeaks website, shakes the hand of a supporter as he leaves Trafalgar Square after addressing the crowd during the 'Antiwar Mass Assembly' organised by the Stop the War Coalition Getty Images 15/23 2011 Journalist John Pilger and Julian Assange, founder of the WikiLeaks website, chat before addressing the crowd during the 'Antiwar Mass Assembly' organised by the Stop the War Coalition at Trafalgar Square Getty Images 16/23 2012 Placards are left by supporters of Julian Assange, the founder of the WikiLeaks whistle-blowing website, outside the Ecuadorian Embassy Getty Images 17/23 2015 WikiLeaks founder Julian Assange with Reverend Jesse Jackson outside the Embassy of Ecuador in London PA 18/23 2016 People attend a video conference of WikiLeaks founder Julian Assange at the International Center for Advanced Communication Studies for Latin America (CIESPAL) auditorium in Quito AFP/Getty Images 19/23 2016 WikiLeaks founder Julian Assange holds up his new kitten at the Ecuadorian Embassy in central London WikiLeaks 20/23 2017 WikiLeaks founder Julian Assange during a press conference from inside the Ecuadorian embassy AP 21/23 2018 Supporters of Julian Assange outside Westminster Magistrates Court, London where a court decision is due on whether a UK arrest warrant against the WikiLeaks founder is still valid PA 22/23 2018 British hacker Lauri Love and his girlfriend Sylvia Mann are surrounded by media after visiting Wikileaks founder Julian Assange in the Ecuadorian embassy in London on 6th February 2018 AFP/Getty Images 23/23 2018 A cat named 'James' wearing a collar and tie yawns by the window of the Ecuadorian Embassy where WikiLeaks founder Julian Assange has been for over five years on 6th February 2018 AFP/Getty Images 1/23 2019 Julian Assange made a defiant gesture with his fist as he arrived at court AFP/Getty Images 2/23 2019 Julian Assange on his arrival at Westminster Magistrates court on April 11 Jack Taylor/Getty Images 3/23 2017 Julian Assange puts his fist in the air as he steps out to speak to the media from the balcony of the Embassy Of Ecuador Getty Images 4/23 2012 Protesters gather outside the Ecuadorian Embassy, where Julian Assange, founder of Wikileaks is staying Getty Images 5/23 2012 Masked supporters of Julian Assange outside the Embassy of Ecuador in Knightsbridge Dominic Lipinski/PA 6/23 2010 Photographers hold cameras to the windows of a Serco prison van believed to be carrying WikiLeaks founder Julian Assange Reuters 7/23 2016 ulian Assange's cat, is adorned with a tie and collar inside the window of the Ecuadorian Embassy PA 8/23 2016 Pamela Anderson delivers lunch to Julian Assange at Embassy of Ecuador Getty Images 9/23 2010 Wikileaks founder Julian Assange is pictured through the heavily tinted windows of a police vehicle as he arrives at Westminster magistrates court in London AFP/Getty Images 10/23 2010 Jemima Kahn leaves the City of Westminster Magistrates Court after offering to stand as surety for Julian Assange Getty Images 11/23 2010 Julian Assange of the WikiLeaks website speaks to reporters in front of a Don McCullin Vietnam war photograph at The Front Line Club in London Getty Images 12/23 2010 Wikileaks founder Julian Assange gestures inside a prison van with red windows as he arrives at the Royal Courts of Justice Getty Images 13/23 2011 WikiLeaks website founder Julian Assange arrives at The High Court Getty Images 14/23 2011 Julian Assange, founder of the WikiLeaks website, shakes the hand of a supporter as he leaves Trafalgar Square after addressing the crowd during the 'Antiwar Mass Assembly' organised by the Stop the War Coalition Getty Images 15/23 2011 Journalist John Pilger and Julian Assange, founder of the WikiLeaks website, chat before addressing the crowd during the 'Antiwar Mass Assembly' organised by the Stop the War Coalition at Trafalgar Square Getty Images 16/23 2012 Placards are left by supporters of Julian Assange, the founder of the WikiLeaks whistle-blowing website, outside the Ecuadorian Embassy Getty Images 17/23 2015 WikiLeaks founder Julian Assange with Reverend Jesse Jackson outside the Embassy of Ecuador in London PA 18/23 2016 People attend a video conference of WikiLeaks founder Julian Assange at the International Center for Advanced Communication Studies for Latin America (CIESPAL) auditorium in Quito AFP/Getty Images 19/23 2016 WikiLeaks founder Julian Assange holds up his new kitten at the Ecuadorian Embassy in central London WikiLeaks 20/23 2017 WikiLeaks founder Julian Assange during a press conference from inside the Ecuadorian embassy AP 21/23 2018 Supporters of Julian Assange outside Westminster Magistrates Court, London where a court decision is due on whether a UK arrest warrant against the WikiLeaks founder is still valid PA 22/23 2018 British hacker Lauri Love and his girlfriend Sylvia Mann are surrounded by media after visiting Wikileaks founder Julian Assange in the Ecuadorian embassy in London on 6th February 2018 AFP/Getty Images 23/23 2018 A cat named 'James' wearing a collar and tie yawns by the window of the Ecuadorian Embassy where WikiLeaks founder Julian Assange has been for over five years on 6th February 2018 AFP/Getty Images

Assange, 48, appeared at Westminster Magistrates' Courts in person on Friday.

The hearing was held in a closed court, but a small crowd of Assange's supporters were gathered outside the building in central London with banners and signs demanding his release.

Journalists were also denied entry to the courtroom.

Assange later gave evidence to a Spanish judge in the case via video link to Madrid.

Assange spent nearly seven years holed up in the embassy.

He is currently being held in HMP Belmarsh awaiting the outcome of an extradition request by the US.

The hearing was unconnected to the US extradition case.

In that he faces 18 charges including conspiracy to commit computer intrusion and is accused of working with former US army intelligence analyst Chelsea Manning to leak hundreds of thousands of classified documents.

Reporting by agencies.