We recorded head direction (HD) cells from the lateral mammillary nucleus (LMN) and anterior thalamus (ATN) of freely behaving rats and also made bilateral lesions of LMN while recording HD cells from ATN. We discovered that the tuning functions of LMN HD cells become narrower during contraversive head turns, but not ipsiversive head turns, compared to when the head is not turning. This narrowing effect does not occur for ATN HD cells. We also found that the HD signal in LMN leads that in ATN by about 15-20 ms. When LMN was lesioned bilaterally, HD cells in ATN immediately lost their directional firing properties and never recovered them. Based on these findings, we argue that LMN may be an essential component of an attractor-integrator network that participates in generating the HD signal.