In this paper, a structure-preserving algorithm is developed for the computation of a semi-stabilizing solution of a Generalized Algebraic Riccati Equation (GARE). The semi-stabilizing solution of GAREs has been used to characterize the solvability of the (J, J ′ )-spectral factorization problem in control theory for general rational matrices which may have poles and zeros on the extended imaginary axis. The main difficulty in solving such a GARE lies in the fact that its associated Hamiltonian/skew-Hamiltonian pencil has eigenvalues on the extended imaginary axis. Consequently, it is not clear which eigenspace of the associated Hamiltonian/skew-Hamiltonian pencil can characterize the desired semi-stabilizing solution. That is, it is not clear which eigenvectors and principal vectors corresponding to the eigenvalues on the extended imaginary axis should be contained in the eigenspace that we wish to compute. Hence, the well-known generalized eigenspace approach for the classical algebraic Riccati equations cannot be employed directly. The proposed algorithm consists of a structure-preserving doubling algorithm (SDA) and a postprocessing procedure to determine the desired eigenvectors and principal vectors corresponding to the purely imaginary and infinite eigenvalues. Under mild assumptions, linear convergence of rate 1/2 for the SDA is proved. Numerical experiments illustrate that the proposed algorithm performs efficiently and reliably.