In this paper we report on a direct numerical simulation (DNS) of turbulent heat transfer in a T-junction. In particular, we study the interaction between two liquid streams, a hot horizontal cross-flow and a cold vertical liquid jet coming from above, in a T-junction of rectangular cross-section. We discuss in detail the instantaneous flow structures and present results for the first- and second-order statistics of the flow quantities, and for the budget of the turbulent kinetic energy. Further, we present results of the power spectral density of the velocity and temperature signals at selected locations of the flow field. Our analysis elucidates the properties of the important features of the flow such as the large recirculation bubble and the secondary separation zones that are formed in the vicinity of the entry of the jet. According to our simulations, thermal mixing is mainly driven by the shear layer between the two streams and, to a lesser extent, by the shear layer between the incoming jet and the large recirculation bubble. Thermal mixing is further enhanced by turbulence generation in the regions of adverse pressure gradients downstream of the large recirculation bubble. Within the framework of our study, we have also conducted a wall-resolved large-eddy simulation (LES) of the flow of interest so as to assess its predictive capacity. Overall, the LES predictions agree satisfactorily with our DNS data; the most noticeable discrepancy is that the LES produces mildly diffused profiles for the second-order statistics in the regions of intense turbulence production.