structural:summarization, linguistic:voice_change
Exile in the Ottoman Empire

The Ottomans initially welcomed the Swedish king when he went to Abdurrahman Pasha, commander of Özü Castle, as he was about to fall into the hands of the Russian army, and he was able to take refuge in the castle at the last moment. Afterward, he settled in Bender at the invitation of its governor, Ağa Yusuf Pasha.

In the meantime, Charles sent Stanisław Poniatowski and Thomas Funck as his messengers to Constantinople. They managed to indirectly contact Gülnuş Sultan, mother of Sultan Ahmed III, who became intrigued by Charles, and took an interest in his cause, and even corresponded with him in Bender.

His expenses during his long stay in the Ottoman Empire were covered by the Ottoman state budget, as part of the fixed assets (Demirbaş in Turkish), hence his nickname Demirbaş Şarl (Fixed Asset Charles) in Turkey.

Eventually, a small village named Karlstad (Varnița) had to be built near Bender to accommodate the ever-growing Swedish population there.

Gülnuş Sultan convinced her son to declare war against Russia, as she thought that Charles was a man worth taking a risk for. Later on, the Ottomans and Russians signed the Treaty of the Pruth and Treaty of Adrianople to end the hostilities between them. The treaties dissatisfied the pro-war party supported by King Charles and Stanislaw Poniatowski, who failed to reignite the conflict.

However, the Sultan Ahmed III's subjects in the empire eventually got tired of Charles' scheming. His entourage also accumulated huge debts with Bender merchants. Eventually, "crowds" of townspeople attacked the Swedish colony at Bender and Charles had to defend himself against the mobs and the Ottoman janissaries involved. This uprising was called "kalabalık" (Turkish for crowd) which afterward found a place in Swedish lexicon referring to a ruckus. The janissaries did not shoot Charles during the skirmish at Bender, but captured him and put him under house-arrest at Dimetoka (nowadays Didimoticho) and Constantinople. During his semi-imprisonment the King played chess and studied the Ottoman Navy and the naval architecture of the Ottoman galleons. His sketches and designs eventually led to the famous Swedish war ships Jarramas (Yaramaz) and Jilderim (Yıldırım).

Meanwhile, Russia and Poland regained and expanded their borders. Great Britain, an adversary of Sweden, defected from its alliance obligations while Prussia attacked Swedish holdings in Germany. Russia occupied Finland (the Greater Wrath 1713–1721). After defeats of the Swedish army, consisting mainly of Finnish troops in the Battle of Helsinki (1713), the Battle of Pälkäne 1713 and the Battle of Storkyro 1714, the military, administration and clergymen escaped from Finland, which fell under Russian military regime.

During his five-year stay in the Ottoman Empire, Charles XII corresponded with his sister (and eventual successor), Ulrika Eleonora. According to Mrs. Ragnhild Marie Hatton, a Norwegian-British historian, in some of those letters Charles expressed his desire for a peace treaty which would be defensible in the future Swedish generations' eyes. However, he emphasized that only a greater respect for Sweden in Europe would enable him to achieve such a peace treaty. Meanwhile, the Swedish Council of State (government) and Estates/Diet (Parliament) tried to keep the beleaguered Sweden somehow organized and independent. Eventually, in the autumn of 1714, their warning letter reached him. In it, those executive and legislative bodies told the absentee King that unless he quickly returned to Sweden, they would independently conclude an achievable peace treaty with Russia, Poland and Denmark. This stark admonition prompted Charles to rush back to Sweden.

Charles traveled back to Sweden with a group of Ottomans, soldiers such as escorts and businessmen to whom he promised to repay his debts during his stay in the Ottoman Empire, but they had to wait several years before that happened. According to the prevailing church law in Sweden at that time, all who lived in the country, but were not members of the Swedish state church, would be baptized. In order for the Jewish and Muslim creditors to avoid this, Charles wrote a "free letter" so that they could practice their religions without being punished. The soldiers chose to remain in Sweden instead of difficult trips home. They were called "Askersson" (the word asker in Turkish means soldier). However, there are accounts implying that following the long stay for Charles to repay his debts, they got paid and left the country.