This paper presents a compact and discriminative hidden Markov model (HMM) approach for general pattern classification. To achieve model compactness and discriminability, we simultaneously perform feature dimension reduction and HMM parameter estimation via maximizing the confidence of accepting the hypothesis that observations are from target HMM states rather than competing HMM states. A new discriminative training criterion is derived using hypothesis test theory. Particularly, we develop the maximum confidence hidden Markov modeling (MCHMM) framework for face recognition. Using this framework, we incorporate a transformation matrix to extract discriminative facial features. The continuous-density HMM parameters are estimated using the extracted features. Importantly, we adopt a consistent criterion to build whole framework including feature extraction and model estimation. From the experiments on ORL facial databases, we find that the proposed method obtains robust image segmentation performance in presence of different variations of facial expressions, orientations, etc. In comparison of previous HMM approaches, the proposed MCHMM achieves better recognition accuracies and image segmentation.