What is called the Edict of Milan was an agreement reached in the city in 313 between Constantine and Licinius and then issued as instructions to provincial governors. It granted freedom of worship to Christians and to everyone else, and ordered the restitution of confiscated church property. It did not make Christianity the state religion, which came seventy years later, but it ended official persecution in the Roman world and it did so from Milan, then an imperial residence.
Ambrose became bishop in 374 by acclamation while serving as the provincial governor and not yet baptised, and he defined what a bishop could be. When the imperial court demanded the use of a basilica for the Homoian congregation the empress favoured, he refused, and his people occupied the church for days; Augustine, who was there, records that hymns were sung antiphonally through the vigil to keep spirits up, and dates the western practice of congregational hymn singing to that occupation.
The sharper case came in 390. After a massacre of civilians in the circus at Thessalonica ordered in the emperor's name, Ambrose wrote to Theodosius requiring public penance before he could receive communion, and the emperor submitted. Whatever the details, and they were embellished later, the precedent was set and cited for a thousand years: a bishop had subjected an emperor to the discipline of the church in a matter of state. Every medieval argument about the two powers goes back through this scene.