In a previous work (Mohemmed et al., Method for training a spiking neuron to associate input–output spike trains)  we have proposed a supervised learning algorithm based on temporal coding to train a spiking neuron to associate input spatiotemporal spike patterns to desired output spike patterns. The algorithm is based on the conversion of spike trains into analogue signals and the application of the Widrow–Hoff learning rule. In this paper we present a mathematical formulation of the proposed learning rule. Furthermore, we extend the application of the algorithm to train a SNN consisting of multiple spiking neurons to perform spatiotemporal pattern classification and we show that the accuracy of classification is improved significantly over a single spiking neuron. We also investigate a number of possibilities to map the temporal output of the trained spiking neuron into a class label. Potential applications for motor control in neuro-rehabilitation and neuro-prosthetics are discussed as a future work.