In this paper, multivariate optimization was applied for the development of microwave-assisted digestion using diluted nitric acid for the determination of essential (Ca, Co, Cr, Cu, K, Mg, Mn, Mo, Ni, P, Se, and Zn) and nonessential (Al, As, Ba, Pb, and Sr) elements in bean samples. Three variables (nitric acid concentration, temperature, and processing time) were regarded as factors in the optimization study. The optimum working conditions were as follows: 4.0 molL −1 nitric acid, 190 °C, and a 15-min reaction time for step 4, which required a microwave heating program. The proposed procedure was then applied to bean samples from small producers of Bahia and to samples acquired from markets of Salvador, Bahia, Brazil. Pattern recognition techniques were applied to the data sets to characterize samples in relation to their geographical origin, species, and production mode. Some differences were found in the samples taken from the northeastern, central, and southern parts of Brazil.