Inclusion Criteria:  Histologically- or cytologically-confirmed diagnosis of anaplastic thyroid cancer (ATC) or undifferentiated thyroid cancer (UTC). A diagnosis of possible ATC/UTC will be allowed if the clinical presentation is consistent with anaplastic or undifferentiated thyroid cancer.  Disease characteristics one of the following:  Unresectable ATC/UTC limited to the neck:  Subjects must have received radiation therapy or surgery to primary tumor and have subsequent evidence of ATC/UTC.  Metastatic ATC/UTC: either with entirely surgically-removed cancer/metastatic only disease, or with disease in the neck not requiring radiation or surgery to the neck mass  Measurable disease per RECIST v1.1. Lesions situated in a previously-irradiated area are considered measurable if progression has been demonstrated in such lesions. ≥ 18 years of age. Eastern Cooperative Oncology Group (ECOG) performance status of 0 to 1 (within 7 days prior to the first dose of pembrolizumab). Absolute neutrophil count (ANC) ≥ 1500/µL (within 10 days prior to the first dose of pembrolizumab). Platelets ≥ 100 000/µL (within 10 days prior to the first dose of pembrolizumab). Hemoglobin ≥ 9.0 g/dL or ≥ 5.6 mmol/L (within 10 days prior to the first dose of pembrolizumab). Criteria must be met without erythropoietin dependency and without packed red blood cell (pRBC) transfusion within last 2 weeks. Creatinine ≤ 1.5 × ULN OR Measured or calculated creatinine clearance per institutional standard ≥ 30 mL/min for subject with creatinine levels >1.5 × institutional ULN (GFR can also be used in place of creatinine or CrCl) (test within 10 days prior to the first dose of pembrolizumab). Total bilirubin ≤ 1.5 × ULN OR Direct bilirubin ≤ ULN for participants with total bilirubin levels >1.5 × ULN (test within 10 days prior to the first dose of pembrolizumab). AST (SGOT) and ALT (SGPT) ≤ 2.5 × ULN (≤ 5 × ULN for participants with liver metastases) (test within 10 days prior to the first dose of pembrolizumab). International normalized ratio (INR) ≤ 1.5 × ULN OR Prothrombin time (PT) ≤ 1.5 × ULN (Exception: subject is receiving anticoagulant therapy and PT or aPTT is within therapeutic range of intended use of anticoagulants) The subject [or legally acceptable representative (LAR) if applicable] has the apparent ability to understand and the willingness to personally sign the written IRB-approved informed consent document. Not a woman of childbearing potential (WOCBP), or if WOCBP, not pregnant (negative urine pregnancy test within 72 hours prior to first dose of pembrolizumab), not breastfeeding, and agrees to follow contraceptive guidance per protocol Appendix A. NOTE: if the urine test is positive or cannot be confirmed as negative, a negative serum pregnancy test is required.  Exclusion Criteria:  Has received prior therapy with an anti-PD-1, anti-PD-L1, or anti-PD-L2 agent or with an agent directed to another stimulatory or co-inhibitory T-cell receptor (eg, CTLA-4, OX-40, CD137). Has received prior systemic anti-cancer therapy including investigational agents within 4 weeks prior to study treatment start. Note: Participants must have recovered from all AEs due to previous therapies to ≤ Grade 1 or baseline. Participants with ≤ Grade 2 neuropathy may be eligible. Participants with endocrine-related AEs Grade ≤ 2 requiring treatment or hormone replacement may be eligible. Note: If the participant had major surgery, the participant must have recovered adequately from the procedure and/or any complications from the surgery prior to starting study intervention. Note: Patients who have most recently been treated with dabrafenib and/or trametinib and/or lenvatinib require a washout period of 1 week from their last dose. Has received prior radiotherapy within 2 weeks of start of study intervention. Participants must have recovered from all radiation-related toxicities, not require corticosteroids, and not have had radiation pneumonitis. A 1-week washout is permitted for palliative radiation (≤ 2 weeks of radiotherapy) to non-CNS disease. Has received a live vaccine or live-attenuated vaccine within 30 days prior to the first dose of study drug. Administration of killed vaccines is allowed. Is currently participating in or has participated in a study of an investigational agent or has used an investigational device within 4 weeks prior to the first dose of study intervention. Subject in the follow-up phase of an investigational study may participate as long as it has been ≥4 weeks after the last dose of the previous investigational agent. Has a diagnosis of immunodeficiency or is receiving chronic systemic steroid therapy (in dosing exceeding 10 mg daily of prednisone equivalent) or any other form of immunosuppressive therapy within 7 days prior to the first dose of study drug. Has a known additional malignancy that is progressing or is requiring active treatment within the past 1 year. Subjects with basal cell carcinoma of the skin, squamous cell carcinoma of the skin or carcinoma in situ (eg, breast carcinoma, cervical cancer in situ) that have undergone potentially curative therapy are not excluded. Has known active CNS metastases and/or carcinomatous meningitis. Participants with previously treated brain metastases may participate provided they are radiologically stable, ie, without evidence of progression for at least 4 weeks by repeat imaging (note that the repeat imaging should be performed during study screening), clinically stable and without requirement of steroid treatment for at least 14 days prior to first dose of study intervention. Has a history of non-infectious pneumonitis/interstitial lung disease that required steroids or has current pneumonitis/interstitial lung disease (ILD). Has an active infection requiring systemic therapy. Has a known history of Human Immunodeficiency Virus (HIV) infection. Note: HIV testing is not required unless mandated by local health authority. Has a known history of Hepatitis B (defined as Hepatitis B surface antigen [HBsAg] reactive) or known active Hepatitis C virus (defined as HCV RNA is detected) infection. Note: no testing for Hepatitis B and Hepatitis C is required unless mandated by local health authority Has active autoimmune disease that has required systemic treatment in the past 2 years (ie, with use of disease modifying agents, corticosteroids or immunosuppressive drugs). Replacement therapy (eg, thyroxine, insulin, or physiologic corticosteroid replacement therapy for adrenal or pituitary insufficiency, etc) is not considered a form of systemic treatment and is allowed. Has severe hypersensitivity (≥ Grade 3) to pembrolizumab and/or any of its excipients. Has other co-morbid disease or intercurrent illness. Has a history or current evidence of any condition, therapy, or laboratory abnormality that might confound the results of the study, interfere with the participant's participation for the full duration of the study, or is not in the best interest of the participant to participate, in the opinion of the treating investigator. Has known psychiatric or substance abuse disorders that would interfere with cooperation with the requirements of the trial. Is pregnant or breastfeeding or expecting to conceive or father children within the projected duration of the study, starting with the screening visit through 120 days after the last dose of trial treatment. Has had an allogenic tissue/solid organ transplant.