The professorship in botany at the University of Copenhagen became vacant with the death of A.S. Ørsted and Warming was the obvious candidate for a successor. However, he was passed over and the chair given to the older, but much less productive and original Ferdinand Didrichsen. Warming then became docent of botany at the University of Copenhagen, the polytechnic (Polyteknisk Læreanstalt) and the Pharmaceutical College 1873–1882. He became professor in botany at "Stockholms högskola" (later Stockholm University) 1882–1885. As the eldest professor, he was elected rector magnificus. In 1885, he became professor in botany at the University of Copenhagen and director of the Copenhagen Botanical Garden and held these positions until his retirement on 31 December 1910. He was rector magnificus of the University of Copenhagen 1907–1908.