The invention relates to novel hemin derivatives of general formula (I), preparing and use thereof as antibacterial and/or antiviral agents, including, as a component in a pharmaceutical compositions. Advantages of the novel antibacterial and antiviral agents based on the hemin derivatives are in their biocompatibility, biodegradability, a high efficacy against resistant bacteria and widespread viruses which are dangerous to humans, and the lack of toxicity.