The anti-programmed cell death protein 1 (anti-PD-1) antibody is a breakthrough immune checkpoint inhibitor that modulates T-cell function. However, it may result in multiple immune-related adverse events (irAEs), such as endocrine toxicity. The present case report describes a 59-year-old female patient with advanced non-small cell lung cancer with a tumor proportion score of 50% for programmed death ligand 1. The patient developed dry skin, dizziness and fatigue after receiving the third infusion of the anti-PD-1 antibody pembrolizumab. Based on several clinical indicators, including low serum free T3 and free T4 titers, an elevated thyroid-stimulating hormone level and a high titer of thyroid peroxidase autoantibody, the patient was diagnosed with immune-induced autoimmune thyroiditis. The patient received continuous thyroxine replacement therapy until her thyroid function returned to normal. After the fifth infusion of pembrolizumab, the patient exhibited hyperglycemia, high serum ketone levels and low arterial blood pH, thus meeting the criteria for immune-induced autoimmune diabetes and diabetic ketoacidosis. As a result, the immunotherapy was discontinued and the patient was diagnosed with insulin-dependent diabetes mellitus. Following anti-PD-1 medication, the patient experienced autoimmune thyroid damage and autoimmune diabetes. Therefore, clinicians should regularly monitor patients undergoing immunotherapy and pay close attention to the characteristics irAEs. Patients with underlying thyroiditis should be carefully monitored due to this being a risk factor, and for patients with thyroiditis care should be taken when deciding on whether they should be treated with immunotherapy. The article also discusses the features and general mechanisms of immune-related endocrine toxicity.