Both species found where a useful tool was hidden three years after performing a task only four times.
They were also able to recall a unique event two weeks later.
The team say their work, published in Current Biology, shows memory for past events is not unique to humans.
Chimps and orangutans were presented with two boxes in different rooms, one of which had useful tools, the other useless ones. In order to get a reward they had to successfully retrieve the useful tools.
Three years later, without witnessing them being hidden, they retrieved the useful tools correctly.