The artist confirmed he is responsible for the work with a post on Instagram, showing the graffiti before it was covered over.
It shows a protester lying on the ground holding a blood-spattered placard, while the judge, in a wig and gown, looms over him wielding a gavel.
Banksy, whose identity is the source of constant speculation, captioned the pictures: “Royal Courts Of Justice. London.”
The artwork is being guarded by security officials outside the building and sits underneath a CCTV camera.
His stencilled graffiti often comments on political issues and many of his pieces are critical of government policy, war and capitalism.
The latest work comes after almost 900 demonstrators were arrested for protesting against the banning of Palestine Action as a terror group in central London on Saturday.
Several others have previously been charged with allegedly expressing support for the group, which was proscribed under anti-terror laws by then-home secretary Yvette Cooper earlier this year.
Responding to Banksy’s work, a spokesperson for campaign group Defend Our Juries, which organised Saturday’s rally, said it “powerfully depicts the brutality unleashed by Yvette Cooper on protesters by proscribing Palestine Action”.
They said: “When the law is used as a tool to crush civil liberties, it does not extinguish dissent, it strengthens it.
“As Banksy’s artwork shows, the state can try to strip away our civil liberties, but we are too many in number and our resolve to stand against injustice cannot be beaten – our movement against the ban is unstoppable and growing every day.”
The work also comes weeks after the Lady Chief Justice, the most senior judge in England and Wales, repeated concerns for the safety of judges, who she said had been subjected to “increasing and increasingly unacceptable sensationalist and inaccurate abuse”.
At a speech at Mansion House in July, Baroness Carr said: “More needs to be done to deal with what are not only attacks on individual judges, but attacks on our democratic process.
“Without judges, acting independently and impartially, to interpret and give effect to the law … our democratic process, our Parliamentary process, would be as nought.”
Last summer, Banksy made headlines with his animal-themed collection in the capital, which concluded with a gorilla appearing to lift up a shutter on the entrance to London Zoo.
Other notable works included piranhas swimming on a police sentry box in the City of London, turning the box into what looked like a giant fish tank, and a howling wolf on a satellite dish, which was taken off the roof of a shop in Peckham, south London, less than an hour after it was unveiled.
The animals collection was made up of nine works including a rhino seemingly mounting a silver Nissan Micra, two elephant silhouettes with their trunks stretched out towards each other and three monkeys that looked as though they were swinging on a bridge.