The diazo group is an important functional group that can confer biological activity to natural products owing to its high reactivity. Recent studies have revealed that diazo groups are synthesized from amino groups using nitrous acid in secondary metabolites of actinomycetes. However, genome database analysis indicated that there are still many diazo groupbiosynthesizing enzymes for unknown biosynthetic pathways. Here, we discovered an avenalumic acid biosynthesis gene cluster in Streptomyces sp. RI-77 by genome mining of enzymes involved in diazo group formation. Through heterologous expression, the gene cluster was revealed to direct avenalumic acid (AVA) biosynthesis via 3-aminoavenalumic acid (3-AAA). In vitro enzyme assays showed that AvaA6 and AvaA7 catalyzed the diazotization of 3-AAA using nitrous acid and substitution of the diazo group for hydride to synthesize AVA, respectively. This study revealed an unprecedented pathway for amino group removal via diazotization.