Taste is responsible for evaluating the nutritious content of food, guiding essential appetitive behaviours, preventing the ingestion of toxic substances, and helping to ensure the maintenance of a healthy diet. Sweet and bitter are two of the most salient sensory percepts for humans and other animals; sweet taste allows the identification of energy-rich nutrients whereas bitter warns against the intake of potentially noxious chemicals. In mammals, information from taste receptor cells in the tongue is transmitted through multiple neural stations to the primary gustatory cortex in the brain. Recent imaging studies have shown that sweet and bitter are represented in the primary gustatory cortex by neurons organized in a spatial map, with each taste quality encoded by distinct cortical fields. Here we demonstrate that by manipulating the brain fields representing sweet and bitter taste we directly control an animal's internal representation, sensory perception, and behavioural actions. These results substantiate the segregation of taste qualities in the cortex, expose the innate nature of appetitive and aversive taste responses, and illustrate the ability of gustatory cortex to recapitulate complex behaviours in the absence of sensory input.