We propose and design a practical modulationcoded (MC) physical-layer network coding (PNC) scheme to approach the capacity limits of Gaussian and fading two-way relay channels (TWRCs). In the proposed scheme, an irregular repeat-accumulate (IRA) modulation-code over GF(q) with the same random-coset is employed at the two users, which directly maps the message sequences into coded PAM or QAM symbol sequences. The relay chooses appropriate network coding coefficients and computes the associated finite-field linear combinations of the two users' message sequences using an iterative belief propagation algorithm. For a symmetric Gaussian TWRC, we show that by introducing the same random-coset vector at the two users, and a time-varying accumulator in the IRA code, the MC-PNC scheme exhibits symmetry and permutation-invariant properties for the soft information distribution of the network coded message sequence (NCMS). We explore these properties in analyzing the convergence behavior of the scheme and optimizing the modulation-code to approach the capacity limit of TWRC. For a block fading TWRC, we present a new MC linear PNC (MC-LPNC) scheme and an algorithm used at the relay for computing the NCMS. We demonstrate that our developed schemes achieve the near-capacity performance in both Gaussian and Rayleigh fading TWRCs. For example, our designed codes over GF(7) and GF(3) with code rate 3 4 are within 1 dB and 1.2 dB of the TWRC capacity, respectively. Our method can be regarded as a practical embodiment of the notion of computeand-forward with good nested lattice code, and can be applied to a wide range of network configurations.Index Terms-two-way relay channel (TWRC), physical-layer network coding (PNC), irregular repeat-accumulate (IRA) code, compute-and-forward (CF).L. Yang is with the School , IEEE Transactions on Wireless Communications 2 of the Gaussian TWRC, the authors of [8], [9] designed binary irregular repeat-accumulate (IRA) coded PNC using an extrinsic information transfer (EXIT) chart curve-fitting technique. Yet, in these works, only BPSK modulation was considered for low or low-to-medium rate regime.It is known that a reliable PNC scheme is of greatest interests in high rate regime. Therefore, the problem of designing practical reliable PNC schemes with high-level modulations and high-rate channel codes is of significant importance. So far, results in this direction are very limited. The main difficulty lies in that the existing multi-level coding (MLC) and bit-interleaved coded-modulation (BICM) schemes [10] based on binary channel codes do not exhibit the ambiguityfree mapping property [13]. This motivates us to design new PNC schemes with high-level modulations to approach the capacity of Gaussian TWRC. In this paper, we aim to design a practical coding scheme whose decoding SNR threshold is close to the capacity limit of the TWRC, e.g. within 1-2 dB for moderately long block length. Such a scheme is said to "achieve the near-capacity performance" of the TWRC.2) Fading TWRC: Although reliable PN...