Antimicrobial peptides (AMPs) are major components of the innate immune defense. Accumulating evidence suggests that the antibacterial activity of many AMPs is dependent on the formation of amyloid-like fibrils. To identify novel fibril forming AMPs, we generated a spleen-derived peptide library and screened it for the presence of amyloidogenic peptides. This approach led to the identification of a C-terminal 32-mer fragment of alpha-hemoglobin, termed HBA(111–142). The non-fibrillar peptide has membranolytic activity against various bacterial species, while the HBA(111–142) fibrils aggregated bacteria to promote their phagocytotic clearance. Further, HBA(111–142) fibrils selectively inhibited measles and herpes viruses (HSV-1, HSV-2, HCMV), but not SARS-CoV-2, ZIKV and IAV. HBA(111–142) is released from its precursor by ubiquitous aspartic proteases under acidic conditions characteristic at sites of infection and inflammation. Thus, HBA(111–142) is an amyloidogenic AMP that may specifically be generated from a highly abundant precursor during bacterial or viral infection and may play an important role in innate antimicrobial immune responses.Supplementary InformationThe online version contains supplementary material available at 10.1007/s00018-023-04795-8.