One experiment involved placing red and yellow stickers on the birds in positions which could only be seen in a mirror.
When looking at their reflection, the magpies became focused on the marks as they tried to reach the stickers with their beaks and claws.
On a number of occasions they succeeded in removing the stickers, and only then did the behaviour stop. Black marks that did not show up against the birds' dark feathers did not garner the same response.
When there was no mirror present, the birds took no notice of the coloured marks.
Dr Helmut Prior, from the Goethe University in Frankfurt said:
We do not claim that the findings demonstrate a level of self-consciousness or self-reflection typical of humans," the researchers wrote in Plos Biology.
The findings do, however, show that magpies respond in the mirror and mark test in a manner so far only clearly found in apes, and, at least suggestively, in dolphins and elephants.
This is a remarkable capability that is at least a pre-requisite of self-recognition and might play a role in perspective taking.