A multi-hop two-way relay channel is considered in which all the terminals are equipped with multiple antennas. Assuming independent quasi-static Rayleigh fading channels and channel state information available at the receivers, we characterize the optimal diversity-multiplexing gain tradeoff (DMT) curve for a full-duplex relay terminal. It is shown that the optimal DMT can be achieved by a compress-and-forward type relaying strategy in which the relay quantizes its received signal and transmits the corresponding channel codeword. It is noteworthy that, with this transmission protocol, the two transmissions in opposite directions can achieve their respective single user optimal DMT performances simultaneously, despite the interference they cause to each other. Motivated by the optimality of this scheme in the case of the two-way relay channel, a novel dynamic compress-and-forward (DCF) protocol is proposed for the one-way multi-hop MIMO relay channel for a half-duplex relay terminal, and this scheme is shown to achieve the optimal DMT performance.