The problem of identifying materials in dual-energy CT images arises in many applications in medicine and security. In this paper, we introduce a new algorithm for joint segmentation and classification of material regions. In our algorithm, we learn an appearance model for patches of pixels that captures the correlation in observed values among neighboring pixels/voxels. We pose the joint segmentation/classification problem as a discrete optimization problem using a Markov random field model for correlation of class labels among neighboring patches, and solve the problem using graph cut techniques. We evaluate the performance of the proposed method using both simulated phantoms and data collected from a medical scanner. We show that our algorithm outperforms the alternative approaches in which the appearance model is based on pixel values instead of patches.