In retrospect, perhaps the wisest thing he could have done, having made up his mind to join Charles, would have been to remain at Baturin until Charles' army could arrive. Even when Menshikov appeared, there was little he and his unsupported cavalry could have done against a fortress protected by cannon. But Mazeppa did not know how many Russians were approaching. He did know and fear Menshikov, and he feared even more Peter's reaction to the news of his betrayal. Deciding that the game was up, he mounted his horse, gathered 2,000 men around him, posted another 3,000 to guard Baturin, commanding them not to admit Menshikov to the town, and galloped north to throw in his lot with the King of Sweden. For Peter, the situation was saved by Menshikov's swift and decisive movements. The Prince arrived at Baturin on October 26 to find that Mazeppa had vanished and that those Cossacks still inside the town refused to permit his men to enter. Surprised and suspicious, he questioned people in the countryside and learned that Mazeppa had ridden by with a large number of horsemen on his way to cross the Desna. The ominous implications of this news were confirmed when a party of Cossack officers asked Menshikov for protection against their Hetman, who, they said, had gone to join the Swedes and betray the Tsar.
Realizing that Peter must immediately learn what had happened, Menshikov left Prince Golitsyn with a force of cavalry outside Baturin to screen the town while he himself galloped to the Tsar, who was accompanying Sheremetev's army. When Peter heard of Mazeppa's betrayal, he was stunned, but he did not lose his head. The greater danger—to be prevented at all costs—was the spreading of Mazeppa's treason.
The Tsar reacted vigorously to prevent this chain reaction. The night he heard of Mazeppa's betrayal, he ordered Menshikov to dispatch dragoori regiments to block any movement by the nearest bands of Ukrainian and Zaporozsky Cossacks to join Mazeppa in the Swedish camp. The following day, October 28, Peter issued a formal proclamation to the people of the Ukraine. Declaring Mazeppa's treachery, he appealed to their Orthodox faith: Mazeppa had deserted to the Swedes, he said, "in order to put the land of Little Russia [the Ukraine] as before the dominion of Poland and to turn the churches and monasteries over to the Catholics." Circulating the proclamation in all the towns and villages of the Ukraine and the lower Volga, he called on the Cossacks to support a new hetman in their fight against the Swedish invader who was the ally of their traditional enemy, the Poles. On a less exalted level, he appealed to the well-known cupidity of the freebooter Cossacks, offering rewards for Swedish prisoners: 2,000 roubles would be paid for a captured Swedish general, 1,000 for a colonel and five for an ordinary soldier. A dead Swede was worth three roubles.
Peter quickly turned to the immediate military situation. It seemed clear that Charles would head for Mazeppa's fortified capital, Baturin, where, it was common knowledge, there were large stores of powder and food. A hastily convened war council decided that Menshikov must return to Baturin with a strong force, including artillery, and assault the town before the Swedes and Mazeppa could reach it. Peter, knowing that the Swedes were about to cross the Desna, was nervous. Repeatedly, as Menshikov was making ready, the Tsar urged him to hurry and to be firm and merciless.
The race for Baturin was on.
During these last days of October, as Charles' army approached the Desna, the Swedish soldiers were cheered by the arrival of Mazeppa and his strange-looking Cossacks. They had hoped that there would be more Cossacks, but these were promised once the army reached Baturin. And for both officers and men, the imminent prospect of reaching a friendly, fortified town where permanent quarters, good food and plenty of powder were waiting was sufficient to lift their spirits. Thus, despite the fact that the Russians had seized the crossing at Novgorod-Seversky and that the Swedes would be forced to cross the river in open country against a Russian force under Hallart, Charles' men were cheerful. The crossing was not easy; the Desna was a broad, fast-flowing stream with high banks, and the first freezing days of winter had already filled the river with drifting ice. On November 3, with Mazeppa at his side, Charles employed his favorite tactic. He feinted a crossing upstream to confuse the Russians, then launched a powerful assault directly across the river at the enemy's center. Late in the afternoon, having overcome the determined opposition of a smaller Russian force, the King of Sweden stepped onto the soil of the Ukraine. His objective now was clear. Baturin was to the south and the road to the Cossack capital lay open. But, unknown to Charles, on the very day the King crossed the river and set foot in the Ukraine, Baturin had ceased to exist.
Menshikov had won the race. With a force of cavalry and mounted infantry, he arrived back at Baturin on November 2 to find the Cossacks inside caught between loyalties to their Hetman and to the Tsar. Their first response to Menshikov's demands was that the Russians could not enter until a new hetman had been elected and given them orders. Menshikov, knowing that the enemy was pressing forward, renewed his demand for immediate entry. Again the garrison refused, insisting, however, that it was faithful to the Tsar and would permit his troops to enter after a three-day wait to allow it to withdraw freely. Menshikov rejected the delay, countering that if the garrison came out at once, no harm would be done to it. Forced to a decision, the Cossacks hardened and sent the messenger back with a defiant cry: "We will all die here, but we will not allow the Tsar's troops to come in."
At dawn the following moming, November 3, Menshikov's troops stormed Baturin, and after a two-hour battle the fortress capitulated (some say a gate was opened to the Russians by a disaffected Cossack). Peter had left to Menshikov's discretion what to do with the town. As Menshikov saw it, he had no choice. The main Swedish army and Mazeppa were approaching rapidly; he had no time and too few men to prepare the town's defenses for a siege; he could not allow Baturin and its supplies of food and ammunition to be captured by Charles. Accordingly, he ordered the city demolished. His troops slaughtered all the 7,000 inhabitants, soldiers and civilians alike, except for a thousand who fought their way free. Everything movable was distributed among Menshikov's soldiers, the supplies so desperately needed by the Swedes were destroyed and the whole town razed to the ground by fire. Baturin, the ancient stronghold of the Cossacks, disappeared.
The fate of Baturin, Peter believed, would serve as an example to others contemplating treason. And indeed, from his viewpoint, the town's cruel destruction had a salutary effect. It was a brutal stroke, a summary punishment which Cossacks understood, demonstrating to them where the greatest power to punish lay. To further circumscribe the effect of Mazeppa's betrayal, Peter immediately summoned the Cossack elders and officers. His candidate—the Cossack colonel of Starodub, Skoropadsky—was elected hetman to succeed Mazeppa. The following day, the Metropolitan of Kiev and two archbishops arrived. With full church ceremonial, they publicly excommunicated Mazeppa and pronounced the curse of anathema on him. To make the impression even more vivid, Mazeppa's portrait was dragged through the streets, then swung from a rope on a gallows next to the bodies of the leaders of the Baturin garrison. A similar ceremony of anathema was repeated in Moscow and in all the churches of Russia and the Ukraine, and a proclamation promised a similar fate to all other traitors to the Tsar.