We use firm-level panel data for the manufacturing sector in four African countries to investigate whether exporting impacts on efficiency, and whether efficient firms self-select into the export market. Based on simultaneous estimation of a production function and an export regression, our preferred results indicate significant efficiency gains from exporting, which can be interpreted as of learning by exporting. We show that modelling unobserved heterogeneity by a flexible approach is important for deriving this conclusion. A policy implication of our results is that Africa would gain from orientating its manufacturing sector towards exporting.