The patent concerns a universal method for obtaining highly purified homogentisic acid polymer (pyomelanin), which includes the stage of efficient separation of microbial cells and macromolecular fractions from homogentisic acid, the stage of rapid polymerization of homogentisic acid into pyomelanin, and the stage of efficient isolation of the pure polymer using physicochemical methods.