Bergman lectured at the University of Uppsala on physics and mathematics. Upon the resignation of the celebrated Wallerius, Bergman was a candidate for the professorship of chemistry and mineralogy. His competitors charged him with ignorance of the subject, because he had never written on it. To refute them, he shut himself up for some time in a laboratory, and prepared a treatise on the manufacture of alum, which became a standard work. He was appointed a professor of chemistry, and remained at this position for the rest of his life.