For all animals, the taste sense is crucial to detect and avoid ingesting toxic molecules. Many toxins are synthesized by plants as a defense mechanism against insect predation. One example of such a natural toxic molecule is l-canavanine, a nonprotein amino acid found in the seeds of many legumes. Whether and how insects are informed that some plants contain l-canavanine remains to be elucidated. In insects, the taste sense relies on gustatory receptors forming the gustatory receptor (Gr) family. Gr proteins display highly divergent sequences, suggesting that they could cover the entire range of tastants. However, one cannot exclude the possibility of evolutionarily independent taste receptors. Here, we show that l-canavanine is not only toxic, but is also a repellent for Drosophila. Using a pharmacogenetic approach, we find that flies sense food containing this poison by the DmX receptor. DmXR is an insect orphan G-protein–coupled receptor that has partially diverged in its ligand binding pocket from the metabotropic glutamate receptor family. Blockade of DmXR function with an antagonist lowers the repulsive effect of l-canavanine. In addition, disruption of the DmXR encoding gene, called mangetout (mtt), suppresses the l-canavanine repellent effect. To avoid the ingestion of l-canavanine, DmXR expression is required in bitter-sensitive gustatory receptor neurons, where it triggers the premature retraction of the proboscis, thus leading to the end of food searching. These findings show that the DmX receptor, which does not belong to the Gr family, fulfills a gustatory function necessary to avoid eating a natural toxin.