An internally contracted multireference configuration interaction is developed which employs wave functions that explicitly depend on the electron-electron distance (MRCI-F12). This MRCI-F12 method has the same applicability as the MRCI method, while having much improved basis-set convergence with little extra computational cost. The F12b approximation is used to arrive at a computationally efficient implementation. The MRCI-F12 method is applied to the singlet-triplet separation of methylene, the dissociation energy of ozone, properties of diatomic molecules, and the reaction barrier and exothermicity of the F + H(2) reaction. These examples demonstrate that already with basis sets of moderate size the method provides near complete basis set MRCI accuracy, and hence quantitative agreement with the experimental data. As a side product, we have also implemented the explicitly correlated multireference averaged coupled pair functional method (MRACPF-F12).