After the Peace of Zsitvatorok (1606) and the unfavourable result of the wars with Persia, Sultan Ahmed I decided to build a large mosque in Istanbul as recompense. This would be the first imperial mosque to be built in more than forty years. Whereas his predecessors had paid for their mosques with their war booty, Sultan Ahmed I had to withdraw the funds from the treasury, because he had not won any notable victories. This provoked the anger of the ulema, the Muslim legal scholars.