We present a method for supervised, automatic, and reliable classification of healthy controls, patients with bipolar disorder, and patients with schizophrenia using brain imaging data. The method uses four supervised classification learning machines trained with a stochastic gradient learning rule based on the minimization of Kullback-Leibler divergence and an optimal model complexity search through posterior probability estimation. Prior to classification, given the high dimensionality of functional MRI (fMRI) data, a dimension reduction stage comprising two steps is performed: first, a one-sample univariate t-test mean-difference Tscore approach is used to reduce the number of significant discriminative functional activated voxels, and then singular value decomposition is performed to further reduce the dimension of the input patterns to a number comparable to the limited number of subjects available for each of the three classes. Experimental results using functional brain imaging (fMRI) data include receiver operation characteristic curves for the three-way classifier with area under curve values around 0.82, 0.89, and 0.90 for healthy control versus nonhealthy, bipolar disorder versus nonbipolar, and schizophrenia patients versus nonschizophrenia binary problems, respectively. The average three-way correct classification rate (CCR) is in the range of 70%-72%, for the test set, remaining close to the estimated Bayesian optimal CCR theoretical upper bound of about 80% , estimated from the one nearest-neighbor classifier over the same data.