Summer barbecues and warm nights plagued by pesky mosquitoes could finally be a thing of the past.

According to new research from Current Biology, it is possible to train mosquitoes not to bite certain people. The training method is quite simple: try to kill them. According to the research, mosquitoes are capable of learning which people not to attack based on scent and fear.

If you attempt to swat a mosquito dead and it escapes, it will identify your scent and choose to avoid you should it still be hungry. Through the vibrations it feels from the aggressor, the mosquito is warned off from biting. It then pairs the scent with the fear of the vibrations and knows to stay clear for 24 hours.

"Training and testing to scents of humans and other host species showed that mosquitoes can aversively learn the scent of specific humans and single odorants and learn to avoid the scent of rats," the research reveals.

Contrary to popular belief, mosquitoes do not bite people at random. Specific scents attract the insects to bite and the human scent in general is appealing.

"How mosquitoes determine which individuals to bite has important epidemiological consequences. This choice is not random; most mosquitoes specialise in one or a few vertebrate host species, and some individuals in a host population are preferred over others."

This is the first time it has been proved that mosquitoes can not only learn, but also remember. The research team is hopeful that the breakthrough can lead to a medicinal solution to prevent mosquitoes from biting.

According to a graphic from Bill Gates' blog in 2016, mosquitoes are the most deadly insects on the planet because of their ability to transfer diseases - malaria being the worst. Mosquitoes killed 830,000 humans in 2015 compared to sharks which caused six fatalities.