We present 2.5D fast and rigorous forward and inversion algorithms for deep electromagnetic (EM) applications that include crosswell and controlled-source EM measurements. The forward algorithm is based on a finite-difference approach in which a multifrontal LU decomposition algorithm simulates multisource experiments at nearly the cost of simulating one single-source experiment for each frequency of operation. When the size of the linear system of equations is large, the use of this noniterative solver is impractical. Hence, we use the optimal grid technique to limit the number of unknowns in the forward problem. The inversion algorithm employs a regularized Gauss-Newton minimization approach with a multiplicative cost function. By using this multiplicative cost function, we do not need a priori data to determine the so-called regularization parameter in the optimization process, making the algorithm fully automated. The algorithm is equipped with two regularization cost functions that allow us to reconstruct either a smooth or a sharp conductivity image. To increase the robustness of the algorithm, we also constrain the minimization and use a line-search approach to guarantee the reduction of the cost function after each iteration. To demonstrate the pros and cons of the algorithm, we present synthetic and field data inversion results for crosswell and controlled-source EM measurements.