In this paper we apply an immune-inspired approach to generate fuzzy rule bases for classification problems. Our proposal, called Bayesian Artificial Immune System (BAIS), is a hybrid algorithm that replaces the traditional mutation and cloning operators with a probabilistic model, more specifically a Bayesian network, representing the joint distribution of promising solutions. Thus, the algorithm takes into account the relationships among the variables of the problem, avoiding the disruption of already obtained highquality partial solutions (building blocks). Besides the capability to identify and manipulate building blocks, the algorithm maintains diversity in the population, performs multimodal optimization and adjusts the size of the population automatically according to the problem. These attributes are generally absent from alternative algorithms, and can be considered useful attributes when generating fuzzy rule bases, thus guiding to high-performance classifiers. BAIS was evaluated in six wellknown classification problems and its performance compares favorably with that produced by contenders.