Mortality in insects consuming high-protein-and-low-carbohydrate diets resembles a type III lifespan curve with increased mortality at an early age and few survivors that live a relatively long lifespan. We selected for a Drosophila line able to live for a long time on an imbalanced high-protein-low-carbohydrate diet by carrying out five rounds of breeding to select for the most long-lived survivors. Adaptation to this diet in the selected line was studied at the biochemical, physiological and transcriptomic levels. The selected line of flies consumed less of the imbalanced food but also accumulated more storage metabolites: glycogen, triacylglycerides, and trehalose. Selected flies also had a higher activity of alanine transaminase and a higher urea content. Adaptation of the selected line on the transcriptomic level was characterized by down-regulation of genes encoding serine endopeptidases (Jon25i, Jon25ii, betaTry, and others) but up-regulation of genes encoding proteins related to the immune system, such as antimicrobial peptides, Turandot-family humoral factors, hexamerin isoforms, and vitellogenin. These sets of down- and up-regulated genes were similar to those observed in fruit flies with suppressed juvenile hormone signaling. Our data show that the physiological adaptation of fruit flies to a high-protein-low-carbohydrate diet occurs via intuitive pathways, namely a decrease in food consumption, conversion of amino acids into ketoacids to compensate for the lack of carbohydrate, and accumulation of storage metabolites to eliminate the negative effects of excess amino acids. Nevertheless, transcriptomic adaptation occurs in a counter-intuitive way likely via an influence of gut microbiota on food digestion.