Ahmed was a most strict observer of the religious precepts of Islam. In spite of this, he was noted for his enlightened tolerance of other religions. He abolished the restrictions against the building of churches by the Christian subjects of the Porte. He did his best to improve the condition and lighten the burden of the rayas. His administration was free from abuses. He gave an example to all below him by refusing to take money for appointments to offices or for any administrative acts. He kept the treasury well filled, in spite of the many wars he was engaged in. It was, in fact, in the civil administration of the Empire that his ability and wisdom were chiefly conspicuous. His military career was chequered, for though he succeeded in adding to the Empire not a few important territories, he encountered for the first time in its history a great and historic defeat at the hands of the Austrians and a second serious defeat by the Poles.

In 1663 war broke out with Austria, and the Grand Vizier, in command of an army of a hundred and twenty thousand men with a hundred and twenty-three guns, crossed the Danube at Belgrade and marched northwards to Neuhausel, one of the three most important strongholds in the hands of the Austrians, which, after a siege of five weeks, was compelled to surrender. Meanwhile the Khan of the Crimea, at the head of a horde of irregular horsemen, overran Moravia, committing the most frightful devastation and carrying off eighty thousand Christians as captives for sale as slaves.

After the capture of Neuhausel, Ahmed Kiuprili took other minor strongholds in the neighbourhood, and then returned to Belgrade for winter quarters. In the following year he again issued from Belgrade with his army and marched to Neuhausel. He then crossed the River Mur and captured Serivar, and on July 26 he reached Komorn, on the River Raab, on the frontier of Hungary and Styria. The Austro-Hungarian army, under the command of the Comte Montecuculi, a general of great reputation—an Italian by birth and the rival of Turenne—held a position on the River Raab not far from Komorn. It was greatly inferior in numbers to that of the Ottomans. But since the last great battle between the two Powers at Cerestes the Austrians had greatly improved in the quality of their generals and officers and in their armaments. The discipline of the Ottoman troops was no longer what it had been, and they had not kept pace in the improvement in guns.

On August 1, 1664, the two armies met near to the Convent of St. Gotthard, which gave its name to a memorable battle. In spite of their great numerical superiority, the Ottomans met with a severe defeat, largely due to the charge of heavy cavalry of the Austrians, under the command of Prince Charles of Lorraine, soon to become famous as a general. The Turks lost ten thousand men, many of whom were driven into the River Raab and were drowned. Thirty thousand of their cavalry, who were spectators of the battle from the other side of the River Raab, took to flight when they saw the issue of the battle and abandoned fifteen guns. The Grand Vizier was able to draw off the main body of his army without further loss. The Austrian losses were heavy, and they made no effort to follow up their victory. The battle, however, was of supreme importance, for it was the first great defeat of the Ottomans in the field by the Austrians. It broke the prestige of the former, which had been unquestioned since the battle of Mohacz in 1526.

In spite of their victory, the Austrians were willing to negotiate with the Grand Vizier for terms of peace, and ten days after the battle a treaty was signed at Vascar, where the Turks were encamped. It was, in the main, a renewal of the treaty of Silvatorok. So far as it differed, it was favourable to the Ottomans. It provided that Transylvania was to be evacuated by both Austrians and Turks. It recognized Apafy, whose claims had been maintained by the latter, as prince of that province, subject to payment of tribute to the Sultan. Serivar and Neuhausel were to remain in the hands of the Sultan. Of seven palatinates occupied by the Ottomans, four were to remain in their hands and three were to be restored to the Emperor. Ahmed Kiuprili had every reason to be satisfied with this treaty. Though defeated in a pitched battle, he had added to the Empire of the Sultan. He led his armies into winter quarters again at Belgrade at the end of October, and on his return to Constantinople received a popular ovation.

In 1667 Ahmed entered upon another campaign. He was determined to bring to a successful issue the siege of Candia, which for so many years had baffled all the efforts of his predecessors. He landed in the island of Crete with large reinforcements. The city of Candia was defended with the utmost tenacity and courage by the Venetians, under the command of Morosini, later famous for the conquest of the Morea. Ahmed spent nearly three years before the city. He urged on the siege with great engineering skill. The Venetians made every effort to retain possession of the city and of the island by offers of large sums of money. Ahmed Kiuprili proudly replied to these overtures: “We are not money-dealers. We make war to win Candia, and at no price will we abandon it.”

In the course of 1669 the prospect of a successful defence of the city was increased by the arrival of a French fleet, commanded by the Duc de Noailles, and having on board the flower of the French nobility and six thousand soldiers. They were joined later by auxiliary squadrons of the Pope and the Knights of Malta. The combined fleet, consisting of seventy vessels, bombarded the Ottomans from the sea, while the besieged opened fire on their front. The allies hoped to place the Turks between two fires and to draw them from the trenches which invested the city by land. The attack, however, failed owing to the accidental blowing up of some of the attacking vessels. This brought confusion into the whole line. A sortie of the garrison was also unsuccessful. Later, a serious misunderstanding arose between Morosini and the Duc de Noailles, which led to the departure of the allied fleet and the abandonment of the city to its own resources. The garrison was now reduced to four thousand men capable of bearing arms. Defence against the overwhelming forces of the Turks was impossible. Terms of surrender were agreed to. The siege, which had lasted for nearly twenty-five years, was brought to an end. Favourable terms were accorded to Morosini and the garrison. The whole island fell into the hands of the Ottomans, and shortly after this a treaty of peace was effected with the Republic of Venice, which recognized the transfer of Crete, with the exception of three small ports on its coast, which were retained for commercial purposes.

A third war was undertaken in 1672 by Ahmed Kiuprili against Poland in support of the Cossacks of the Ukraine, who had risen against their oppressors, the Poles, and had appealed to the Porte for protection against the invasion of their country by Sobieski. It was decided by Ahmed to support these insurgents. An army of six thousand was sent there, in concert with a much larger force of Tartars from the Crimea. The Czar of Russia joined with the King of Poland in protesting against this intervention of the Porte. The proud answer of the Porte was:—