The presence of bacteria in the midgut of mosquitoes antagonizes infectious agents, such as Dengue and Plasmodium, acting as a negative factor in the vectorial competence of the mosquito. Therefore, knowledge of the molecular mechanisms involved in the control of midgut microbiota could help in the development of new tools to reduce transmission. We hypothesized that toxic reactive oxygen species (ROS) generated by epithelial cells control bacterial growth in the midgut of Aedes aegypti, the vector of Yellow fever and Dengue viruses. We show that ROS are continuously present in the midgut of sugar-fed (SF) mosquitoes and a blood-meal immediately decreased ROS through a mechanism involving heme-mediated activation of PKC. This event occurred in parallel with an expansion of gut bacteria. Treatment of sugar-fed mosquitoes with increased concentrations of heme led to a dose dependent decrease in ROS levels and a consequent increase in midgut endogenous bacteria. In addition, gene silencing of dual oxidase (Duox) reduced ROS levels and also increased gut flora. Using a model of bacterial oral infection in the gut, we show that the absence of ROS resulted in decreased mosquito resistance to infection, increased midgut epithelial damage, transcriptional modulation of immune-related genes and mortality. As heme is a pro-oxidant molecule released in large amounts upon hemoglobin degradation, oxidative killing of bacteria in the gut would represent a burden to the insect, thereby creating an extra oxidative challenge to the mosquito. We propose that a controlled decrease in ROS levels in the midgut of Aedes aegypti is an adaptation to compensate for the ingestion of heme.