Optical nonlinearities at the single-photon level are key ingredients for future photonic quantum technologies1. Prime candidates for the realization of the strong photon-photon interactions necessary for implementing quantum information processing tasks2, as well as for studying strongly correlated photons3-6 in an integrated photonic device setting, are quantum dots embedded in photonic-crystal nanocavities. Here, we report strong quantum correlations between photons on picosecond timescales. We observe (i) photon antibunching upon resonant excitation of the lowest-energy polariton state, proving that the first cavity photon blocks the subsequent injection events, and (ii) photon bunching when the laser field is in two-photon resonance with the polariton eigenstates of the second Jaynes-Cummings manifold7,8, demonstrating that two photons at this colour are more likely to be injected into the cavity jointly than they would otherwise. Together, these results demonstrate unprecedented strong single-photon nonlinearities, paving the way for the realization of a quantum optical Josephson interferometer9 or a single-photon transistor10.