For 46 years she was imprisoned. She had been put there by her father. When the time came for him to decide, her son left her there.

She was born on 6 November 1479 in Toledo, the third child of Isabella of Castile and Ferdinand of Aragon. Her mother ruled Castile in her own right and had just fought a war to keep it. The peace, signed two months before the birth, dealt with Isabella's rival for the throne, her niece, who was also called Juana. She could wait to marry Isabella's one-year-old son or she could enter a convent. She entered the convent. The crown of Castile had already cost one Juana her liberty.

The new baby had an older brother and an older sister ahead of her, and a place in a royal family whose marriages reached across Europe. Her younger sister Catherine would become queen of England.

At sixteen, Juana left Spain to marry Philip of Austria in the Low Countries. The marriage joined her parents' dynasty to the Habsburgs. Then the people standing between her and the succession began to die. Her brother Juan died in 1497, her sister Isabel the following year, and Isabel's little son Miguel in 1500. Within three years, Juana had become the daughter through whom the inheritance would pass.

When Isabella died on 26 November 1504, Juana was twenty-five. She inherited Castile. Her husband wanted to govern it. So did her father. Isabella's will provided for Ferdinand to govern if Juana was absent or unable or unwilling to rule. What looked like a safeguard for the succession became the basis of a struggle over who would exercise her authority.

The crown belonged to Juana. That did not settle who would use it.

Philip and Ferdinand contested the government, making Juana's fitness to rule part of their struggle. She is still known as Juana the Mad. What, if anything, was wrong with her cannot now be diagnosed. The men who called her unfit to rule were the men who ruled instead.

In 1506 Ferdinand withdrew from Castile and Philip took control. That September, Philip died. Juana was twenty-six, widowed and pregnant with their sixth child. On 14 January 1507, at Torquemada, she gave birth to a daughter, Catalina, the Spanish form of Catherine. There were two Catherines in her family now: the sister in England and the baby born after Philip's death.

Ferdinand returned to govern Castile. In 1509 he had Juana brought to Tordesillas, where she was installed in the royal palace. Philip's body came too, and was placed in the convent of Santa Clara. Juana was twenty-nine and still queen. Catalina was two. Mother and daughter had a household and attendants, and Juana retained her rank, but she could not leave at will. The palace became the place where Catalina grew up and where Juana would grow old.

Among the belongings listed when she arrived were seven portraits. There was one of herself, one of Isabella, one of her older sister Isabel, and four of Catherine.

Her mother and her older sister were dead. Catherine was crowned queen of England that June. The two sisters had last met in 1506, briefly, when a storm drove Juana's fleet onto the English coast. They never met again.

Catalina's room could be reached only through her mother's. She remained there through childhood and into her teens. Beyond the palace, her brothers and sisters were taking their places in the ruling families of Europe. Inside it, the youngest daughter of Philip and Juana lived under the restrictions imposed upon her mother.

There were visits. In 1517 Juana's son Charles and his older sister Leonor came to Tordesillas. She had left them in the Low Countries in 1506, when Charles was five. Catalina, now ten, had never met either of them. Their grandfather Ferdinand had died the previous year, and Charles had assumed the title of king alongside Juana. The family had found a way to preserve her royal position without restoring her ordinary freedom.

Then Charles wanted Catalina at his court. In March 1518 a hole was cut through the wall behind a tapestry in her room, and she was taken out that way, weeping. Juana found the hole. She stopped eating and drinking. Within days, Catalina was back.

A queen who could not leave a palace could still refuse a meal.

In 1520, rebels against Charles's government came to Tordesillas. The Comuneros recognised Juana's authority and wanted her support. After eleven years in the palace, she remained important enough for a rebellion to gather around her. They sought her signature on their documents. Papers, pen and ink were put in front of her. They did not obtain it. That December, Charles's supporters took the town back, and Juana remained where she was.

Catalina's departure came in 1525, when she left Tordesillas to marry John III of Portugal. The child who had arrived with her mother in 1509 was leaving to become a queen herself. She had spent sixteen years in that palace. Juana was forty-five. This time there was no hole in the wall and no way of bringing her back.

Juana lived for another thirty years. Her son Charles was emperor, and all four daughters had become queens. She remained queen of Castile through their marriages, their accessions and the growth of another generation of the family. At seventy-five, on Good Friday, 12 April 1555, she died in the palace at Tordesillas. Forty-six years had passed since her father brought her there. She was still queen.