The execution of developmental programs of gene expression requires an accurate partitioning of the genome into subnuclear compartments, with active euchromatin enriched centrally and silent heterochromatin at the nuclear periphery1. The existence of degenerative diseases linked to lamin A mutations suggests that perinuclear binding of chromatin contributes to cell-type integrity2,3. The methylation of lysine 9 of histone H3 (H3K9me) characterizes heterochromatin and mediates both transcriptional repression and chromatin anchoring at the inner nuclear membrane4. In Caenorhabditis elegans embryos, chromodomain protein CEC-4 bound to the inner nuclear membrane tethers heterochromatin through H3K9me3,5, whereas in differentiated tissues, a second heterochromatin-sequestering pathway is induced. Here we use an RNA interference screen in the cec-4 background and identify MRG-1 as a broadly expressed factor that is necessary for this second chromatin anchor in intestinal cells. However, MRG-1 is exclusively bound to euchromatin, suggesting that it acts indirectly. Heterochromatin detachment in double mrg-1; cec-4 mutants is rescued by depleting the histone acetyltransferase CBP-1/p300 or the transcription factor ATF-8, a member of the bZIP family (which is known to recruit CBP/p300). Overexpression of CBP-1 in cec-4 mutants is sufficient to delocalize heterochromatin in an ATF-8-dependent manner. CBP-1 and H3K27ac levels increase in heterochromatin upon mrg-1 knockdown, coincident with delocalization. This suggests that the spatial organization of chromatin in C. elegans is regulated both by the direct perinuclear attachment of silent chromatin, and by an active retention of CBP-1/p300 in euchromatin. The two pathways contribute differentially in embryos and larval tissues, with CBP-1 sequestration by MRG-1 having a major role in differentiated cells.