Immune checkpoint inhibitors have some efficacy in the treatment of hepatocellular carcinoma (HCC). Programmed cell death 1 ligand 1 (PD-L1), expressed on some cancer cells, binds to the receptor programmed cell death 1 (PDCD1, also called PD1) on T cells to prevent their proliferation and reduce the antigen-tumor immune response. Immune cells that infiltrate some types of HCCs secrete interferon gamma (IFNG). Some HCC cells express myocyte enhancer factor 2D (MEF2D), which has been associated with shorter survival times of patients. We studied whether HCC cell expression of MEF2D regulates expression of PD-L1 in response to IFNG. We analyzed immune cells from 20 fresh HCC tissues by flow cytometry. We analyzed 225 fixed HCC tissues (from 2 cohorts) from patients in China by immunohistochemistry and obtained survival data. We created mice with liver-specific knockout of MEF2D (MEF2DLPC-KO mice). We knocked out or knocked down MEF2D, E1A binding protein p300 (p300), or sirtuin 7 (SIRT7) in SMMC-7721, Huh7, H22, and Hepa1-6 HCC cell lines, some incubated with IFNG. We analyzed liver tissues from mice and cell lines by RNA sequencing, immunoblot, dual luciferase reporter, and chromatin precipitation assays. MEF2D protein acetylation and proteins that interact with MEF2D were identified by coimmunoprecipitation and pull-down assays. H22 cells, with MEF2D knockout or without (controls), were transplanted into BALB/c mice, and some mice were given antibodies to deplete T cells. Mice bearing orthotopic tumors grown from HCC cells, with or without knockout of SIRT7, were given injections of an antibody against PD1. Growth of tumors was measured, and tumors were analyzed by immunohistochemistry and flow cytometry. In human HCC specimens, we found an inverse correlation between level of MEF2D and numbers of CD4+ and CD8+ T cells; level of MEF2D correlated with percentages of PD1-positive or TIM3-positive CD8+ T cells. Knockout of MEF2D from H22 cells reduced their growth as allograft tumors in immune-competent mice but not in immune-deficient mice or mice with depletion of CD8+ T cells. When MEF2D-knockout cells were injected into immune-competent mice, they formed smaller tumors that had increased infiltration and activation of T cells compared with control HCC cells. In human and mouse HCC cells, MEF2D knockdown or knockout reduced expression of PD-L1. MEF2D bound the promoter region of the CD274 gene (encodes PD-L1) and activated its transcription. Overexpression of p300 in HCC cells, or knockout of SIRT7, promoted acetylation of MEF2D and increased its binding, along with acetylated histones, to the promoter region of CD274. Exposure of HCC cells to IFNG induced expression of p300 and its binding MEF2D, which reduced the interaction between MEF2D and SIRT7. MEF2D-induced expression of PD-L1 upon IFNG exposure was independent of interferon-regulatory factors 1 or 9. In HCC cells not exposed to IFNG, SIRT7 formed a complex with MEF2D that attenuated expression of PD-L1. Knockout of SIRT7 reduced proliferation of HCC cells and growth of tumors in immune-deficient mice. Compared with allograft tumors grown from control HCC cells, in immune-competent mice, tumors grown from SIRT7-knockout HCC cells expressed higher levels of PD-L1 and had reduced infiltration and activation of T cells. In immune-competent mice given antibodies to PD1, allograft tumors grew more slowly from SIRT7-knockout HCC cells than from control HCC cells. Expression of MEF2D by HCC cells increases their expression of PD-L1, which prevents CD8+ T-cell-mediated antitumor immunity. When HCC cells are exposed to IFNG, p300 acetylates MEF2D, causing it to bind the CD274 gene promoter and up-regulate PD-L1 expression. In addition to promoting HCC cell proliferation, SIRT7 reduced acetylation of MEF2D and expression of PD-L1 in HCC cells not exposed to IFNG. Strategies to manipulate this pathway might increase the efficacy of immune therapies for HCC.