Cohesin-NIPBL complexes extrude genomic DNA into loops that are constrained by CTCF boundaries. This process has important regulatory functions and weakens the separation between euchromatic and heterochromatic compartments. Cohesin can also bind PDS5A or PDS5B, which do not support loop extrusion but are required for the formation of CTCF boundaries. How PDS5 proteins perform this function is unknown. Here we show by in vitro single-molecule imaging that PDS5 proteins stop loop extrusion by facilitating the dissociation of NIPBL from cohesin. Hi-C experiments suggest that this function is required for the establishment of CTCF boundaries in cells. In silico modelling indicates that PDS5 proteins enable the separation between compartments by limiting cohesin's velocity and chromatin-residence time. The degree of this compartmentalization depends on the frequency with which chromatin is extruded relative to the time it takes for compartments to form. These results identify PDS5 proteins as key regulators of genome organization.