If the emperor commands one thing and God another, you must disregard the former and obey God (ST 2-2.104.5).