This study focuses on the performances of monkeys in a spatial problem-solving task that involves working memory. Two monkeys had to find, by trial-and-error, the touching order of 2 or 3 targets in a set of 3 or 4 fixed spatial targets. When a solution was found and performed 6 times, the order was changed and the animal had to resume a new search within the same set of targets. Thus, in a training session, many searches (up to 60) could be initialised. The data show that the animals conducted a methodical search for the hidden order and found the solution in a minimal number of trials. We conclude that the monkey is able to construct complex cognitive structures, similar to logical reasoning, to solve spatial problems of this type.