Immersed boundary (IB) methods deal with incompressible visco-elastic solids interacting with incompressible viscous fluids. A long-standing issue of IB methods is the challenge of accurately imposing the incompressibility constraint at the discrete level. We present the divergence-conforming immersed boundary (DCIB) method to tackle this issue. The DCIB method leads to completely negligible incompressibility errors at the Eulerian level and various orders of magnitude of increased accuracy at the Lagrangian level compared to other IB methods. Furthermore, second-order convergence of the incompressibility error at the Lagrangian level is obtained as the discretization is refined. In the DCIB method, the Eulerian velocity–pressure pair is discretized using divergence-conforming B-splines, leading to inf–sup stable and pointwise divergence-free Eulerian solutions. The Lagrangian displacement is discretized using non-uniform rational B-splines, which enables to robustly handle large mesh distortions. The data transfer needed between the Eulerian and Lagrangian descriptions is performed at the quadrature level using the same spline basis functions that define the computational meshes. This conduces to a fully variational formulation, sharp treatment of the fluid–solid interface, and a 0.5 increase in the convergence rate of the Eulerian velocity and the Lagrangian displacement measured in L2 norm in comparison with using discretized Dirac delta functions for the data transfer. By combining the generalized-α method and a block-iterative solution strategy, the DCIB method results in a fully-implicit discretization, which enables to take larger time steps. Various two- and three-dimensional problems are solved to show all the aforementioned properties of the DCIB method along with mesh-independence studies, verification of the numerical method by comparison with the literature, and measurement of convergence rates.