On leaving Egypt he went back to Germany and completed his Ph.D in 1957, working with Berthold Spuler. In 1958 he was sent to Iraq by the German government to work at its embassy there. Shortly after his arrival in Baghdad, Brigadier Abd al-Karim Qasim overthrew the regime in the bloody military coup known as the 14 July Revolution. Madelung stayed in Iraq two more years. Subsequently, he taught at the University of Chicago.