We present a knowledge-based system for automatic 3D building reconstruction from aerial images. Our approach relies on combining pairs of stereo images with 2D GIS map and domain knowledge. Since most buildings can be described as aggregation of simple building types, the domain knowledge is represented in a building library containing building primitives (flat, gable, and hip roof building). The approach of modeling buildings using a set of basic building models suggests the usage of Constructive Solid Geometry representation for building description. The building reconstruction process is formulated as a hypothesis generation and verification scheme. It starts with the partitioning of a building in simple building parts based on the ground plan defined in the map. For each building partition different building hypotheses are generated corresponding to the building primitives defined in the building library. The evaluation of the generated building models is based on the formulation of the mutual information between the model and the images. The CSG tree representing a building is given by the best fit of the building models corresponding to the building partitions. We used this method to reconstruct buildings in suburban and urban scenes. The method worked well even in difficult conditions (noise, shadow).