The establishment of latency is an essential step for the life-long persistent infection and pathogenesis of Kaposi's sarcoma-associated herpesvirus (KSHV). While the KSHV genome is chromatin-free in the virions, the viral DNA in latently infected cells has a chromatin structure with activating and repressive histone modifications that promote latent gene expression but suppress lytic gene expression. Here, we report a comprehensive epigenetic study of the recruitment of chromatin regulatory factors onto the KSHV genome during the pre-latency phase of KSHV infection. This demonstrates that the KSHV genome undergoes a biphasic chromatinization following de novo infection. Initially, a transcriptionally active chromatin (euchromatin), characterized by high levels of the H3K4me3 and acetylated H3K27 (H3K27ac) activating histone marks, was deposited on the viral episome and accompanied by the transient induction of a limited number of lytic genes. Interestingly, temporary expression of the RTA protein facilitated the increase of H3K4me3 and H3K27ac occupancy on the KSHV episome during de novo infection. Between 24–72 hours post-infection, as the levels of these activating histone marks declined on the KSHV genome, the levels of the repressive H3K27me3 and H2AK119ub histone marks increased concomitantly with the decline of lytic gene expression. Importantly, this transition to heterochromatin was dependent on both Polycomb Repressive Complex 1 and 2. In contrast, upon infection of human gingiva-derived epithelial cells, the KSHV genome underwent a transcription-active euchromatinization, resulting in efficient lytic gene expression. Our data demonstrate that the KSHV genome undergoes a temporally-ordered biphasic euchromatin-to-heterochromatin transition in endothelial cells, leading to latent infection, whereas KSHV preferentially adopts a transcriptionally active euchromatin in oral epithelial cells, resulting in lytic gene expression. Our results suggest that the differential epigenetic modification of the KSHV genome in distinct cell types is a potential determining factor for latent infection versus lytic replication of KSHV. Although the KSHV genome is linear and chromatin-free in the virions, it circularizes and adopts a repressive chromatin structure in latently infected cells, inhibiting the majority of viral gene expression. In this study, we investigate the epigenetic regulatory mechanism of the pre-latency phase of KSHV infection. We found that upon de novo infection, the KSHV genome undergoes distinct chromatin states in a temporally ordered manner prior to the establishment of latency. Initially, the KSHV genome carried a transcriptionally permissive chromatin structure to allow expression of a subset of viral lytic genes. Subsequently, cellular Polycomb Repressive Complex 1 (PRC1) and PRC2 were recruited to the KSHV genome, resulting in the deposition of repressive histone marks onto the viral chromatin and the accumulation of heterochromatin structures, both of which were critical for the establishment of viral latency. In contrast to the biphasic chromatinization and genome-wide inhibition of lytic genes observed in de novo-infected SLK and TIME cells, KSHV adopts a transcriptionally permissive chromatin form in human gingiva-derived epithelial cells, resulting in prolonged and robust lytic gene expression. Thus, our results suggest that the differential epigenetic modification of the KSHV genome in distinct cell types is a potential determining factor for latent infection versus lytic replication of KSHV.