The liver develops from the endoderm layer of the foregut as a bud called the hepatic diverticulum. This bud grows into the mesenchyme and its cells differentiate into the liver parenchyma and biliary system ducts. The gallbladder also develops from the hepatic diverticulum. After birth, the umbilical vein and ductus venosus regress and the liver takes over metabolic functions from the fetal liver.