The respiratory system develops from the ventral wall of the foregut between 4-5 weeks as the respiratory diverticulum. This forms the trachea and lungs buds. The lungs continue developing branches until birth. The lungs are not fully mature at birth and continue developing for years. Surfactant production is important for lung function and its lack can cause respiratory distress in premature infants. Congenital anomalies can include defects in trachea and esophagus separation or abnormal lung lobes.