We investigated the effects of melatonin on rats with induced hypothyroidism during gestation as well as its effect on the development of the gonads of their offspring. Fifteen pregnant rats were divided into three groups: GC, rats without induced hypothyroidism; GH, rats with induced hypothyroidism; GHM, rats with induced hypothyroidism plus melatonin. Hypothyroidism was induced by oral administration of 6-propyl-2-thiouracil and melatonin was applied subcutaneously. Treatments were performed during gestation and lactation. For the matrices, we evaluated the number of pups, body weight gain, ovarian weight, thyroid weight, organosomatic index, thyroid stimulating hormone (TSH) dose and thyroid morphometry. For the pups, weight gain, TSH, weight, morphometry of the gonads and organosomatic index were analyzed, as well as the cell proliferation index. TSH was elevated only in the matrices of GH animals. Melatonin prevented reduction of ovarian and thyroid weight, number of pups, follicular diameter and thyroid epithelial proportion of the matrices with hypothyroidism. The offspring of rats of the GH group exhibited less body weight gain, gonad and thyroid weight, and gonad cell proliferation index compared to the offspring born of rats of the GC and GHM groups. Melatonin prevented the effects of maternal hypothyroidism on the offspring of rats.