Abstract-We present a new algorithm for joint detection and decoding of iteratively decodable codes transmitted over channels affected by a time-varying phase noise (PN) and a constant frequency offset. The proposed algorithm is obtained as an application of the sum-product algorithm to the factor graph representing the joint a posteriori distribution of the information symbols and the channel parameters given the channel output. The resulting algorithm employs the soft-output information on the coded symbols provided by the decoder and performs forwardbackward recursions, taking into account the joint probability distribution of phase and frequency offset. We present simulation results for high-order coded modulation schemes based on low-density parity-check codes and serially concatenated convolutional codes, showing that, despite its low complexity, the algorithm is able to cope with a strong PN and a significant uncompensated frequency offset, thus avoiding the use of complicated data-aided frequency-estimation schemes operating on a known preamble. The robustness of the algorithm in the presence of a time-varying frequency offset is also discussed.Index Terms-Detection and decoding in the presence of phase noise and frequency offset, factor graphs (FGs), iterative detection and decoding, low-density parity-check (LDPC) codes, serially concatenated convolutional codes (SCCCs), sum-product algorithm (SPA), turbo codes (TCs).