Queen of Navarre spent several months fortifying the city. Recruiting troops, she sent them to the assault of the cities around Agen. But, tired of the Queen's demands, the Agenais revolted and agreed with the lieutenant of Henry III. With the arrival of royal troops, Margaret had to flee precipitously. Refusing her mother's pleas that she move to a royal manor, she retreated to her lofty and impregnable fortress of Carlat with Jean de Lard de Galard, seigneur d'Aubiac, her pretended lover, whom she appointed captain of her guards. After a year, probably due to the approach of royal troops, Margaret took refuge in the castle of Ibois, a little to the north of Auvergne, as proposed to her by her mother. But she found herself besieged by the royal troops who seized the fortress. She waited nearly a month for a decision on her fate. On 13 October 1586, Margaret was imprisoned by her brother Henry III in the castle of Usson, in Auvergne. D'Aubiac was executed, despite Catherine de' Medici's wish, in front of Margaret. Margaret assumed she was going to die and in a "farewell" letter to the Queen-Mother, she asked that after her execution a post-mortem be held to prove that she was not, despite gossip, pregnant with d'Aubiac's child. But suddenly, her gaoler, the Marquis de Canillac, switched from the royal side in the civil war to that of the Catholic League and released her in early 1587. Rumors at the court of France reported that she seduced him, but most probably he was bought by her. Her freedom suited the League perfectly: her continued existence guaranteed that Henry of Navarre would remain without an heir. Despite obtaining her freedom, Margaret decided to stay in the castle of Usson, where she spent eighteen years. Of her life in Usson, there is very little reliable information, so a lot of legends have gathered around it. Here, she learned of her mother's death and of her brother Henry III's assassination in 1589. Her husband, Henry of Navarre, became King of France under the name of Henri IV. He was, however, not accepted by most of the Catholic population until he converted four years later. During this time, Margaret was able to train, as she had done at Nérac, a new court of intellectuals, musicians and writers. She restored the castle and committed her time to reading many