The king encamped that night close by the machines of the Saracens, and on the second day after the battle of Massoura, the struggle began afresh. The Saracens had taken the victory to themselves, and had sent the news of their supposed triumph to Cairo by their carrier pigeons. Bondocar, the chief, who had rallied the troops in Massoura appeared on the field in the coat of arms starred with lilies which Robert of Artois had worn. The Greek fire was poured forth incessantly from the front line of the Saracens as they came up in battle array; the king had the crupper of his horse covered with it once during the conflict, when he had gone to the rescue of his brother Charles, who was in danger. The Saracens were repulsed a second time, but the victory was dearly bought, so many men and horses being wounded, and the crusaders passed a dreary time before Massoura, whilst their provisions grew less and less; and it being Lent, they lost their strength by eating only roots, wheat, and fruit; fish they had in plenty at first, but to their horror they found out that they had fed on the dead bodies which the Saracens had thrown into the river. A pestilence broke out, and the camp was like one vast hospital. The king, in mistaken zeal, had caused the bodies to be taken out of the water, that those of the Christians might receive Christian burial, and helped to bury them himself. This only increased the unwholesomeness of the air, and at last Louis fell ill too. The crusaders now began to despair; the king had been as brave in misfortune as he had been on the battle-field, and had cheered the spirits of his followers: he visited the sick day and night, and sat beside the bedside of the dying, reminding them of their Saviour's love, and comforting many a poor soul with the hope of heaven. It is recorded how one of the lowliest of the army declared as he lay dying that he could not depart until he had seen the kind face of his master bending over him once more.

The Saracens having prevented the approach of the vessels that were coming to the camp with provisions, the king, as a last resource, offered to give up the city of Damietta to the Sultan Malek al Moadhem, if he would agree to restore Jerusalem to the Christians, the Counts of Poiton and Anjou remaining in Egypt as hostages.

The Sultan would have no other hostage but the king himself, and Louis would willingly have sacrificed himself for his people if his nobles had allowed him to do so. There was no alternative but to retreat to Damietta, and the army decamped one spring night in the dark, the old people and the sick and wounded being carried out first, and the king leaving the camp the last of all with the barons Gautier de Chatillon and Geoffray de Sardines. He was so weak and ill that he could hardly sit upright on his little Arab horse; yet he was the bravest among the brave in that troop which went slowly and sadly along in the dark, defending themselves as they could from the attacks of the Arabs, who had been bribed for the purpose of molesting them.

Geoffray de Sardines had to deal many a blow to keep the Saracens from his master, who soon became too feeble to lift his sword, and they were in the greater danger because the whole of the Egyptian army was behind them. At last they reached a little village, and the king, having fainted away, was carried into the first house they met with, whilst Chatillon stood outside in the street defending it until he fell mortally wounded.

When Louis had recovered a little, Philip de Montfort came to him, and told him that he had seen an emir, to whom he had been sent on a mission once before, and if he liked he would make a treaty with him on the terms desired by the Saracens.

The king agreed to the plan; De Montfort went to the emir, and all would have been well if a sergeant belonging to the French army, thinking to save the king's life, had not cried out to the knights who were standing around, "Surrender, Sir Knights! the king commands you to do so!" The Christian warriors, believing that the king had really commanded them to give way, lay down their swords, and the emir, seeing they were all prisoners, said there was no further need of a treaty. Then cords and chains were thrown around them, and they were all conducted to Massoura.

The king was shut up in the house of a scribe; he was loaded with chains, and strictly watched, while the barons and knights were huddled together in a court which was open to the sky. King Louis was very unkindly treated by the Sultan at first; he was only allowed to have one attendant with him; this man, whose name was Isambert, nursed him tenderly, dressed him, and made his bread; and said afterwards that he had never heard his master utter one word of complaint or impatience during the whole time of his captivity. It was a marvel how Louis ever lived through his illness; his strength was almost spent; and at night, to add to his discomfort, he had nothing to cover him as he lay on his wretched bed but an old cloak, which a poor man had given him out of compassion in Massoura.

After a time, Malek al Moadhem, fearing the reproaches of the European nations, treated his captive more kindly; he had his chains removed and sent him his own physicians, and delicate food from his royal table, and to keep him warm he gave him two robes of black samite, trimmed and lined with fur, which were plentifully adorned with gold buttons. And best of all he allowed him to have his almoner and a priest with him, and something like joy came back to the poor king when the Saracens brought him one day his missal, or book of prayers, which he had lost and never thought to see again. And so, comforted and strengthened by prayer, Louis was not unhappy even within prison walls, away from all he loved, and waited patiently until the Almighty should see fit to make a way for him to regain his liberty.

And a way came at last: the sultan agreed to release him on condition of his giving up Damietta and paying a ransom of a million besants of gold. Louis agreed to the terms, but he said that the liberty of the King of France should not be bought with money, and that the gold should be paid for his people, and the city should be his own ransom. The sultan, struck with the spirit of his reply, reduced the sum he had asked by two hundred thousand besants, and a truce was concluded between the Christians and the Saracens of Egypt and Syria. It was arranged that half the ransom should be paid at once, and the other half as soon as the king should reach the port of Acre in Palestine, his brother Alphonse remaining in Egypt as hostage. Louis was then set at liberty; he had recovered from his illness through the skill of the Arabian physicians, and he repaired to Acre where the queen and the princesses had already arrived, having quitted Damietta a little while before. It was a joyful meeting, for Marguerite had been very unhappy through all those long sad months at Damietta, not only on account of the miseries of the crusaders, but also from the constant fear of falling into the hands of the Saracens herself. And a little son who was born to her there received the name of "Tristan," in memory of the sorrows she had endured.

Louis did not return to France at once, but remained some time at Acre, in the hope of inducing the Christian powers to enter into a league for the recovery of the Holy Land, and it was not until the news of his mother's death reached him, and his presence was required in his country, that he bade farewell to the East, where he had bravely striven for so much, and yet had gained so little.