The biliary system, pancreas and liver all develop from the nearby foregut at almost the same time in mammals. The molecular mechanisms that determine the identity of each organ in this complex area are unknown. Hes1 encodes the basic helix-loop-helix protein Hes1 (ref. 1), which represses positive basic helix-loop-helix genes such as Neurog3 (ref. 3). Expression of Hes1 is controlled by the evolutionarily conserved Notch pathway. Hes1 operates as a general negative regulator of endodermal endocrine differentiation, and defects in Notch signaling lead to accelerated pancreatic endocrine differentiation. Mutations in JAG1, encoding a Notch ligand, cause the Alagille syndrome in humans, characterized by poor development of the biliary system, suggesting that the Notch pathway is also involved in normal biliary development. Here we show that Hes1 is expressed in the extrahepatic biliary epithelium throughout development and that Hes1-deficient mice have gallbladder agenesis and severe hypoplasia of extrahepatic bile ducts. Biliary epithelium in Hes1-/- mice ectopically expresses the proendocrine gene Neurog3 (refs. 12,13), differentiates into endocrine and exocrine cells and forms acini and islet-like structures in the mutant bile ducts. Thus, biliary epithelium has the potential for pancreatic differentiation and Hes1 determines biliary organogenesis by preventing the pancreatic differentiation program, probably by directly repressing transcription of Neurog3.