Commensal bacteria serve as an important line of defense against colonisation by opportunisitic pathogens, but the underlying molecular mechanisms remain poorly explored. Here, we show that strains of a commensal bacterium, Haemophilus haemolyticus, make hemophilin, a heme-binding protein that inhibits growth of the opportunistic pathogen, non-typeable Haemophilus influenzae (NTHi) in culture. We purified the NTHi-inhibitory protein from H. haemolyticus and identified the hemophilin gene using proteomics and a gene knockout. An x-ray crystal structure of recombinant hemophilin shows that the protein does not belong to any of the known heme-binding protein folds, suggesting that it evolved independently. Biochemical characterisation shows that heme can be captured in the ferrous or ferric state, and with a variety of small heme-ligands bound, suggesting that hemophilin could function under a range of physiological conditions. Hemophilin knockout bacteria show a limited capacity to utilise free heme for growth. Our data suggest that hemophilin is a hemophore and that inhibition of NTHi occurs by heme starvation, raising the possibility that competition from hemophilin-producing H. haemolyticus could antagonise NTHi colonisation in the respiratory tract.