The Church was built by order of holy Roman Emperor Charles IV. In 1737, it's surprisingly not named after him, but after Charles Borromeo, an Italian Bishop who played an important role in the plague.
The style of the church was intended to slightly resemble the Hagia Sophia Mosque in Istanbul.