Barrier-to-autointegration factor (BAF) is an essential, highly conserved, metazoan protein. BAF interacts with LEM (LAP2, emerin, MAN1) domain-carrying proteins of the inner nuclear membrane. We analyzed the in vivo function of BAF in Caenorhabditis elegans embryos using both RNA interference and a temperature-sensitive baf-1 gene mutation and found that BAF is directly involved in nuclear envelope (NE) formation. NE defects were observed independent of and before the chromatin organization phenotype previously reported in BAF-depleted worms and flies. We identified vaccinia-related kinase (VRK) as a regulator of BAF phosphorylation and localization. VRK localizes both to the NE and chromatin in a cell-cycle-dependent manner. Depletion of VRK results in several mitotic defects, including impaired NE formation and BAF delocalization. We propose that phosphorylation of BAF by VRK plays an essential regulatory role in the association of BAF with chromatin and nuclear membrane proteins during NE formation.