Let $\mathsf{H}$ be an infinite-dimensional separable complex Hilbert space and $\mathcal{B}(\mathsf{H})$ the algebra of all bounded linear operators on $\mathsf{H}.$ In this paper, we prove that if a surjective linear map $ \phi : \mathcal{B}(\mathsf{H}) \longrightarrow \mathcal{B}(\mathsf{H})$ preserves the index of operators, then $\phi$ preserves compact operators in both directions and the induced map $ \varphi : \mathcal{C}( \mathsf{H}) \longrightarrow \mathcal{C}(\mathsf{H}),$ determined by $\varphi(\pi(T)) = \pi( \phi(T)) $ for all $T \in \mathcal{B}(\mathsf{H}),$ is a continuous automorphism multiplied by an invertible element in $\mathcal{C}( \mathsf{H}).$
Key words: Linear preserver problems, index of operator, semi-Fredholm operator.