Functional exhaustion of antigen-specific T cells is a defining characteristic of many chronic infections, but the underlying mechanisms of T cell dysfunction are not well understood. Epigenetics plays an important role in the control of T cell development, differentiation, and function. To examine if epigenetics also plays a role in T cell exhaustion, we analyzed chromatin remodeling in CD8(+) T cells from mice with chronic lymphocytic choriomeningitis virus infection. We observed downregulation of diacetylated histone H3 in both virus-specific and total CD8(+) T cells, and functional defects not only in virus-specific CD8(+) T cells but also within the total CD8(+) T cell population. In vitro treatment of these exhausted CD8(+) T cells with histone deacetylase inhibitors restored diacetylated histone H3 levels, and improved their immune functions. Upon adoptive transfer, these treated CD8(+) T cells developed into functional memory T cells in vivo that enhanced protective immunity. These results define a role of epigenetics in T cell exhaustion and suggest epigenetic manipulation as a novel molecular therapy to restore immune functions.