The near-exact iCIPT2 approach for strongly correlated systems of electrons, which stems from the combination of iterative configuration interaction (iCI, an exact solver of full CI) with configuration selection for static correlation and second-order perturbation theory (PT2) for dynamic correlation, is extended to the relativistic domain. In the spirit of spin separation, relativistic effects are treated in two steps: scalar relativity is treated by the infinite-order, spin-free part of the exact two-component (X2C) relativistic Hamiltonian, whereas spin-orbit coupling (SOC) is treated by the first-order, Douglas-Kroll-Hess-like SOC operator derived from the same X2C Hamiltonian. Two possible combinations of iCIPT2 with SOC are considered, i.e., SOiCI and iCISO. The former treats SOC and electron correlation on an equal footing, whereas the latter treats SOC in the spirit of state interaction, by constructing and diagonalizing an effective spin-orbit Hamiltonian matrix in a small number of correlated scalar states. Both double group and time reversal symmetries are incorporated to simplify the computation. Pilot applications reveal that SOiCI is very accurate for the spin-orbit splitting (SOS) of heavy atoms, whereas the computationally very cheap iCISO can safely be applied to the SOS of light atoms and even of systems containing heavy atoms when SOC is largely quenched by ligand fields.