John was, at the age of twenty-five, elected pensionary of the city of Dordrecht, and two years later, in 1652, Grand Pensionary of Holland, one of the highest offices in the United Provinces. His political influence was very great, and he used it to the best of his ability against the house of Orange. William the Second, Prince of Orange, had died on the second of October, 1650, leaving only a widow and a posthumous son as his heirs. On these circumstances, so unfavorable to the illustrious house which had played for so many years a conspicuous part in the history of the Netherlands, John de Witt built his hopes of dealing a deathblow to its political pretensions and of abolishing forever the office of stadtholder. It was, however, no easy task to accomplish this object. The province of Zealand was full of friends and partisans of the late stadtholder, who vigorously opposed any attempt in the direction contemplated by De Witt; and the other provinces, either from loyalty to the house of Orange, or from a secret jealousy of the supremacy of the states of Holland, which always wanted to control the policy of the Republic, either openly rejected the plans of De Witt or modified and attenuated them as exaggerated.
At the moment when John de Witt took the reins of government, the states were at war with England, and the war had taken a very unfavorable turn for them. The Dutch admirals had suffered several terrible defeats. Tromp, one of their most celebrated naval heroes, had been killed in battle, and an English fleet was cruising along the coast of Holland, blockading its ports, and paralyzing its commerce. But De Witt repaired these disasters with such rapidity, and restored to the Dutch navy such a formidable strength by his administrative genius, that Cromwell was willing to enter into negotiations for peace, which he had haughtily rejected before. A treaty of peace, submitted by the Grand Pensionary of Holland and signed at Westminster on the fifteenth of April, 1654, reëstablished virtually the conditions which had existed between the two nations before the war. However, the Dutch Republic was compelled to recognize the superiority of the English flag in the channel, and bound itself to give the Stuart dynasty no support, and that no Prince of Orange should be elected again either Stadtholder or Captain-General. This last section of the treaty was signed, at first by the province of Holland only, and was kept secret for a long time. In getting this provision of exclusion of the house of Orange passed (which, by the way, was as welcome to De Witt as to Cromwell) by the other provinces also, the Grand Pensionary practised a good deal of duplicity, and laid himself open to serious charges of official deception which later on contributed to his downfall.