Deep learning has led to significant advances in artificial intelligence, in part, by adopting strategies motivated by neurophysiology. However, it is unclear whether deep learning could occur in the real brain. Here, we show that deep learning can be achieved by moving away from point neuron models and towards multi-compartment neurons. Like neocortical pyramidal neurons, neurons in our model receive feedforward sensory information and higher-order feedback in electrotonically segregated compartments. Thanks to this segregation, the network can calculate local synaptic weight updates that allow it to categorize images from the MNIST data-set with good accuracy. We show that our learning algorithm can take advantage of multilayer architectures to identify abstract categories—the hallmark of deep learning. This work demonstrates that deep learning can be achieved using segregated dendritic compartments for feedforward and feedback information, which may help to explain the dendritic morphology of neocortical pyramidal neurons.