A conspicuous feature of cortical organization is the wide diversity of inhibitory interneurons, their differential computational functions remain unclear. Here we propose a local cortical circuit in which three major subtypes of interneurons play distinct roles. In a model designed for spatial working memory, stimulus tuning of persistent activity arises from the concerted action of widespread inhibition mediated by perisoma-targeting (parvalbumin-containing) interneurons and localized disinhibition of pyramidal cells via interneuron-targeting (calretinin-containing) interneurons. Moreover, resistance against distracting stimuli (a fundamental property of working memory) is dynamically controlled by dendrite-targeting (calbindin-containing) interneurons. The experimental observation of inverted tuning curves of monkey prefrontal neurons recorded during working memory supports a key model prediction. This work suggests a framework for understanding the division of labor and cooperation among different inhibitory cell types in a recurrent cortical circuit.