Spinal cord injury leads to a massive response of innate immune cells in non-regenerating mammals, but also in successfully regenerating zebrafish. However, the role of the immune response in successful regeneration is poorly defined. Here we show that inhibiting inflammation reduces and promoting it accelerates axonal regeneration in spinal-lesioned zebrafish larvae. Mutant analyses show that peripheral macrophages, but not neutrophils or microglia, are necessary for repair. Macrophage-less irf8 mutants show prolonged inflammation with elevated levels of Tnf-α and Il-1β. Inhibiting Tnf-α does not rescue axonal growth in irf8 mutants, but impairs it in wildtype animals, indicating a pro-regenerative role of Tnf-α. In contrast, decreasing Il-1β levels or number of Il-1β+ neutrophils rescue functional regeneration in irf8 mutants. However, during early regeneration, interference with Il-1β function impairs regeneration in irf8 and wildtype animals. Hence, inflammation is dynamically controlled by macrophages to promote functional spinal cord regeneration in zebrafish.