Reversion and spread of vaccine-derived poliovirus (VDPV) to cause outbreaks of poliomyelitis is a rare outcome resulting from immunisation with the live-attenuated oral poliovirus vaccines (OPVs). Global withdrawal of all three OPV serotypes is therefore a key objective of the polio endgame strategic plan, starting with serotype 2 (OPV2) in April 2016. Supplementary immunisation activities (SIAs) with trivalent OPV (tOPV) in advance of this date could mitigate the risks of OPV2 withdrawal by increasing serotype-2 immunity, but may also create new serotype-2 VDPV (VDPV2). Here, we examine the risk factors for VDPV2 emergence and implications for the strategy of tOPV SIAs prior to OPV2 withdrawal. We first developed mathematical models of VDPV2 emergence and spread. We found that in settings with low routine immunisation coverage, the implementation of a single SIA increases the risk of VDPV2 emergence. If routine coverage is 20%, at least 3 SIAs are needed to bring that risk close to zero, and if SIA coverage is low or there are persistently "missed" groups, the risk remains high despite the implementation of multiple SIAs. We then analysed data from Nigeria on the 29 VDPV2 emergences that occurred during 2004-2014. Districts reporting the first case of poliomyelitis associated with a VDPV2 emergence were compared to districts with no VDPV2 emergence in the same 6-month period using conditional logistic regression. In agreement with the model results, the odds of VDPV2 emergence decreased with higher routine immunisation coverage (odds ratio 0.67 for a 10% absolute increase in coverage [95% confidence interval 0.55-0.82]). We also found that the probability of a VDPV2 emergence resulting in poliomyelitis in >1 child was significantly higher in districts with low serotype-2 population immunity. Our results support a strategy of focused tOPV SIAs before OPV2 withdrawal in areas at risk of VDPV2 emergence and in sufficient number to raise population immunity above the threshold permitting VDPV2 circulation. A failure to implement this risk-based approach could mean these SIAs actually increase the risk of VDPV2 emergence and spread.