Soon after this Mazeppa opened the communication above referred to with the King of Sweden, and at last an agreement was made between them by which it was stipulated that the king was to advance into the southern part of the country, where, of course, the Cossacks would be sent out to meet him, and then Mazeppa was to revolt from the Czar, and go over with all his forces to the King of Sweden's side. By this means the Czar's army was sure, they thought, to be defeated; and in this case the King of Sweden was to remain in possession of the Russian territory, while the Cossacks were to retire to their own fortresses, and live thenceforth as an independent tribe.

The plot seemed to be very well laid; but, unfortunately for the contrivers of it, it was not destined to succeed. In the first place, Mazeppa's scheme of revolting with the Cossacks to the enemy was discovered by the Czar, and almost entirely defeated, before the time arrived for putting it into execution. Peter had his secret agents every where, and through them he received such information in respect to Mazeppa's movements as led him to suspect his designs. He said nothing, however, but manoeuvred his forces so as to have a large body of troops that he could rely upon always near Mazeppa and the Cossacks, and between them and the army of the Swedes. He ordered the officers of these troops to watch Mazeppa's movements closely, and to be ready to act against him at a moment's notice, should occasion require. Mazeppa was somewhat disconcerted in his plans by this state of things; but he could not make any objection, for the troops thus stationed near him seemed to be placed there for the purpose of co-operating with him against the enemy.

In the mean time, Mazeppa cautiously made known his plans to the leading men among the Cossacks as fast as he thought it prudent to do so. He represented to them how much better it would be for them to be restored to their former liberty as an independent tribe, instead of being in subjugation to such a despot as the Czar. He also enumerated the various grievances which they suffered under Russian rule, and endeavored to excite the animosity of his hearers as much as possible against Peter's government.

He found that the chief officers of the Cossacks seemed quite disposed to listen to what he said, and to adopt his views. Some of them were really so, and others pretended to be so for fear of displeasing him. At length he thought it time to take some measures for preparing the minds of the men generally for what was to come, and in order to do this he determined on publicly sending a messenger to the Czar with the complaints which he had to make in behalf of his men. The men, knowing of this embassy, and understanding the grounds of the complaint which Mazeppa was to make by means of it, would be placed, he thought, in such a position that, in the event of an unfavorable answer being returned, as he had no doubt would be the case, they could be the more easily led into the revolt which he proposed.

Mazeppa accordingly made out a statement of his complaints, and appointed his nephew a commissioner to proceed to head-quarters and lay them before the Czar. The name of the nephew was Warnarowski. As soon as Warnarowski arrived at the camp, Peter, instead of granting him an audience, and listening to the statement which he had to make, ordered him to be seized and sent to prison, as if he were guilty of a species of treason in coming to trouble his sovereign with complaints and difficulties at such a time, when the country was suffering under an actual invasion from a foreign enemy.

As soon as Mazeppa heard that his nephew was arrested, he was convinced that his plots had been discovered, and that he must not lose a moment in carrying them into execution, or all would be lost. He accordingly immediately put his whole force in motion to march toward the place where the Swedish army was then posted, ostensibly for the purpose of attacking them. He crossed a certain river which lay between him and the Swedes, and then, when safely over, he stated to his men what he intended to do.

The men were filled with indignation at this proposal, which, being wholly unexpected, came upon them by surprise. They refused to join in the revolt. A scene of great excitement and confusion followed. A portion of the Cossacks, those with whom Mazeppa had come to an understanding beforehand, were disposed to go with him, but the rest were filled with vexation and rage. They declared that they would seize their chieftain, bind him hand and foot, and send him to the Czar. Indeed, it is highly probable that the two factions would have come soon to a bloody fight for the possession of the person of their chieftain, in which case he would very likely have been torn to pieces in the struggle, if those who were disposed to revolt had not fled before the opposition to their movement had time to become organized. Mazeppa and those who adhered to him—about two thousand men in all—went over in a body to the camp of the Swedes. The rest, led by the officers that still remained faithful, marched at once to the nearest body of Russian forces, and put themselves under the command of the Russian general there.

A council of war was soon after called in the Russian camp for the purpose of bringing Mazeppa to trial. He was, of course, found guilty, and sentence of death—with a great many indignities to accompany the execution—was passed upon him. The sentence, however, could not be executed upon Mazeppa himself, for he was out of the reach of his accusers, being safe in the Swedish camp. So they made a wooden image or effigy to represent him, and inflicted the penalties upon the substitute instead.

In the first place, they dressed the effigy to imitate the appearance of Mazeppa, and put upon it representations of the medals, ribbons, and other decorations which he was accustomed to wear. They brought this figure out before the camp, in presence of the general and of all the leading officers, the soldiers being also drawn up around the spot. A herald appeared and read the sentence of condemnation, and then proceeded to carry it into execution, as follows. First, he tore Mazeppa's patent of knighthood in pieces, and threw the fragments into the air. Then he tore off the medals and decorations from the image, and, throwing them upon the ground, he trampled them under his feet. Then he struck the effigy itself a blow by which it was overturned and left prostrate in the dust.

The hangman then came up, and, tying a halter round the neck of the effigy, dragged it off to a place where a gibbet had been erected, and hanged it there.