Sub-Saharan Africa is becoming an increasingly important destination for international migration. The region hosts immigrants from other African countries and from other parts of the world, such as China. Given high poverty levels and weak social security systems in Sub-Saharan Africa, host populations might fear increasing competition for resources and labor, potentially resulting in negative attitudes towards immigrants. We provide the first systematic study of attitudes towards immigrants in Sub-Saharan African countries that uses a causal framework. Using a survey experiment in Uganda and Senegal, we study both attitudes towards immigrants in general and towards specific immigrant groups. In particular, we focus on Chinese immigrants, whose increasing presence in Africa is seen by many as the most important contemporary geopolitical shift involving the continent. We find that attitudes towards immigrants are mainly driven by sociotropic cultural and sociotropic economic concerns. Furthermore, immigrants from China are perceived less positively and economically more threatening than immigrants in general.