YY1 is a transcription factor that can repress or activate the transcription of a variety of genes. Here, we show that the function of YY1 as a repressor in cardiac myocytes is tightly dependent on its ability to interact with histone deacetylase 5 (HDAC5). YY1 interacts with HDAC5, and overexpression of YY1 prevents HDAC5 nuclear export in response to hypertrophic stimuli and the increase in cell size and re-expression of fetal genes that accompany pathological cardiac hypertrophy. Knockdown of YY1 results in up-regulation of all genes present during fetal development and increases the cell size of neonatal cardiac myocytes. Moreover, overexpression of a YY1 deletion construct that does not interact with HDAC5 results in transcription activation, suggesting that HDAC5 is necessary for YY1 function as a transcription repressor. In support of this relationship, we show that knockdown of HDAC5 results in transcription activation by YY1. Finally, we show that YY1 interaction with HDAC5 is dependent on the HDAC5 phosphorylation domain and that overexpression of YY1 reduces HDAC5 phosphorylation in response to hypertrophic stimuli. Our results strongly suggest that YY1 functions as an antihypertrophic factor by preventing HDAC5 nuclear export and that up-regulation of YY1 in human heart failure may be a protective mechanism against pathological hypertrophy.