We present an optimal method for decoding the activity of primary motor cortex (M1) neurons in a non-human primate during finger movements. The method is based on the maximum likelihood (ML) inference. Each neuron's activation is first quantified by the change in firing rate before and after finger movement. We then estimate the probability density function of this activation given finger movement. Based on the ML criterion, we choose finger movements to maximize the likelihood. With as few as 20-25 randomly selected neurons, the proposed method decoded single finger movements with 99% accuracy. Since the training and decoding procedures in the proposed method are simple and computationally efficient, the method can be extended for real-time neuroprosthetic control of a dexterous hand.