In this paper, we study a multi-period stochastic perishable inventory system with multiple demand classes that require products of different ages. The firm orders the product with a positive leadtime and sells it to multiple demand classes, each only accepting products with remaining lifetime longer than a threshold. In each period, after demand realization, the firm decides how to allocate the on-hand inventory to different demand classes with different backorder or lost-sale cost. At the end of each period, the firm can dispose inventory of any age. We formulate this problem as a Markov decision process and characterize the optimal ordering, allocation, and disposal policies. When unfulfilled demand is backlogged, we show that the optimal order quantity is decreasing in the inventory levels and is more sensitive to the inventory level of fresher products, the optimal allocation policy is a sequential rationing policy, and the optimal disposal policy is characterized by a set of thresholds. For the lost-sale case, we show that the optimal allocation and disposal policies have the same structure but the optimal ordering policy may be different. Based on the structure of the optimal policy, we develop an efficient heuristic that is at most 4% away from the optimal cost in our numerical examples. Using numerical studies, we show that the ordering and allocation policies are close to optimal even if the firm cannot intentionally dispose products. Moreover, ignoring the difference between demand classes and using a simple allocation policy (e.g., FIFO) can significantly increase the total cost. We examine how the firm can improve the control of perishable items and show that the benefit of decreasing the leadtime is more significant than that of increasing the lifetime of the products or that of decreasing the acceptance threshold of the demand. The analysis is extended to systems with age dependent disposal cost and stochastic supply.