Although the M/D/1/N queueing model is well solved from a computational point of view, there is no known analytical expression of the queue length distribution. In this paper, we derive closed-form formulae for the distribution of the number of customers in the system in the finite-capacity M/D/1 queue. We also give an explicit solution for the mean queue length and the average waiting time.