Buoyant flow beneath oceanic spreading centres can be driven by density gradients due to thermal expansion and compositional gradients arising from the extraction of melt. Numerical experiments are used to examine the pattern of mantle flow and melting produced by these two sources of buoyancy. Compositional buoyancy leads to three-dimensional flow beneath the spreading axis with along-axis variations in upwelling and melt production. Thermal buoyancy drives axis-parallel circulation and convective rolls aligned perpendicular to the spreading axis that originate at a distance off-axis controlled by the spreading rate and mantle viscosity. The distance from the axis to the onset of observed sea-floor gravity lineations may show a similar dependence on spreading rate. Compositional density stratification suppresses the formation of thermally driven rolls near the axis, and when it is large causes the thermal rolls to become unstable, leading to time-dependent behaviour. The amount of crust produced is less sensitive to spreading rate than in passive flow models, however it has a maximum at intermediate spreading rates, due to the presence of thermally driven upwelling in the melting region. Along-axis variations in upwelling and melt production suggest that buoyant flow may have an important effect on the segmentation of spreading centres, particularly at slow spreading rates.