In 1982, an extraterrestrial mothership arrives and hovers over Johannesburg, South Africa. Inside, an investigation team finds over a million starved insectoid and crustacean-like aliens and the South African government voluntarily relocates the asylum seekers to a refugee camp called District 9. 28 years later, District 9 becomes both a ghetto and a shanty town, and humans come to view the aliens, derogatorily called "prawns," as filthy, violent animals who bleed resources from them. The Prawns have been systematically reduced to second-class citizens there and have been known to consume canned cat food.
Following unrest between the aliens and humans, the government hires the Multinational United (MNU), a large defense contractor, to forcibly relocate the extraterrestrials to a labour camp outside the city. Piet Smit, an MNU executive, appoints his son-in-law and MNU bureaucrat, Wikus van de Merwe, to lead the forced relocation. Meanwhile, three aliens, Christopher Johnson, his young son CJ, and Paul search a District 9 refuse dump for Prawn technology; Christopher has spent the last 20 years synthesizing fuel from their contents. They finally fill an entire container in Paul's shack as the relocation begins, but when Wikus comes to serve Paul a notice, he finds the hidden container and accidentally sprays some fuel into his face. Koobus Venter, a cruel MNU mercenary who is speciesist against the Prawns, kills Paul.
Wikus begins mutating into a Prawn, starting with his left arm that was injured after the exposure. He is taken to an underground MNU lab, where researchers discover his hybrid DNA grants Wikus the ability to operate Prawn weaponry, which is biologically restricted from humans. When there, Wikus discovers the grisly medical experiments, including vivisections the scientists were performing on the Prawns. Seeing the potential for profitable weapons research, Smit orders Wikus's organs to be harvested for genetic material. Wikus, however, overpowers the lab personnel and escapes. While Venter's forces hunt him, a fake news story is broadcast claiming Wikus is a wanted fugitive, who has contracted a contagious disease from copulating with extraterrestrials.
Wikus takes refuge in District 9, finding Christopher and the spaceship's command module dropship concealed underneath his shack. Christopher explains that the confiscated fuel is needed to reactivate the dropship, which can then dock with the mothership. This would allow Christopher to rescue his species and return home, and cure Wikus with the equipment onboard. Encouraged by a phone call from his wife, Tania, Wikus steals powerful alien weapons from Obasanjo, a Nigerian crime lord who believes that eating Wikus' alien arm will grant him alien abilities.