Some neurons (delay cells) in the prefrontal cortex elevate their activities throughout the time period during which the animal is required to remember past events and prepare future behavior, suggesting that working memory is mediated by continuous neural activity. It is unknown, however, how working memory is represented within a population of prefrontal cortical neurons. We recorded from neuronal ensembles in the prefrontal cortex as rats learned a new delayed alternation task. Ensemble activities changed in parallel with behavioral learning so that they increasingly allowed correct decoding of previous and future goal choices. In well-trained rats, considerable decoding was possible based on only a few neurons and after removing continuously active delay cells. These results show that neural activity in the prefrontal cortex changes dynamically during new task learning so that working memory is robustly represented and that working memory can be mediated by sequential activation of different neural populations.