Registration of histology to three-dimensional (3D) magnetic resonance (MR) images is often required for the analysis of brain structure and investigation of brain pathologies. A novel algorithm for deformable registration of an individual histological section to a brain MR image is described. The cost function uses a novel hybrid intensity- and boundary surface-based measure that reflects the contrast of histological slice intensities across the boundary of the pial and inner cortical surface. The algorithm relies on implicit representation of cortical surfaces reconstructed from an anatomical MR image, and computes the cost function in a level set framework. The algorithm is evaluated on cross-modality registration of myelin-stained histological sections to a high-resolution MR image of the human brain.