In the last decade, extensive studies on the properties of non-membrane-bound compartments in the cellular cytoplasm have shown that concepts in phase separation drawn from physical chemistry can describe their formation and behaviour1–4. Current evidence also suggests that phase separation plays a role in the organization inside the cell nucleus5–8. However, the influence and role of DNA on the physical chemistry of phase separation is not well understood. Here, we are interested in the role of interactions between phase separating proteins and the DNA surface. The interaction of liquid phases with surfaces has been extensively studied in soft matter physics, in the context of macroscopic surfaces and non-biological liquids9–11. The conditions in the nucleus are different from those studied in conventional soft matter physics because DNA with a diameter of about 2 nm12 provides a microscopic surface, and liquid-like phases are complex mixtures of proteins subject to a myriad of biochemical modifications13. Transcriptional condensates, which are thought to serve as regulatory hubs in gene expression14–21, provide an accessible system to investigate the physics of condensates that emerge from DNA-protein and protein-protein interactions. These condensates are typically small22, and the mechanisms that determine their size are unknown. Whether they can be understood as phase separated compartments has been subject to debate23–26. Here, we use optical tweezers to directly observe the condensation of the pioneer transcription factor Klf427,28 on DNA in vitro. We demonstrate that Klf4 forms microphases that are enabled by interaction with the DNA surface. This sets their typical size and allows them to form below the saturation concentration for liquid-liquid phase separation. We combine experiment with theory to show that these microphases can be understood as forming by surface condensation on DNA via a switch-like transition similar to prewetting. Polymer surface mediated condensation reconciles several observations that were previously thought to be at odds with the idea of phase separation as an organizing principle in the nucleus.