Anna was the eldest daughter of Maximilian II, Holy Roman Emperor, and Maria of Spain, who were first cousins. She was born in Spain during the reign of her maternal grandfather, Emperor Charles V, but lived in Vienna from the age of four. Anna was considered her father's favorite child. The story goes that he enjoyed playing and gambling with her and once a meeting of the Estates of Hungary was postponed because Anna was sick. She received a Catholic education even though her father was sympathetic to Lutheranism.
Marriage
As the eldest daughter of the Holy Roman Emperor, Anna was a desirable candidate for marriage at the European courts. Her parents thought a Spanish marriage would strengthen links between the Austrian and Spanish Habsburg families. Initially she considered her cousin Don Carlos, the only son of her maternal uncle Philip II of Spain. These plans were shattered in 1568 when Don Carlos died. Plans for a Spanish marriage were revived when Philip's third wife, Elisabeth of Valois, died in childbirth, also in 1568. As a result, Philip was left a widower with two young daughters, Isabella Clara Eugenia and Catherine Michelle. Philip planned to remarry because he no longer had a male heir. The marriage was at first opposed by many, including Pope Pius V, but it was arranged all the same. In February 1569, Anna's engagement to her uncle Philip II was announced and in May 1570 they married by proxy. Anna traveled from Austria to Spain in the autumn of 1570 accompanied by her brothers Albert and Wenceslaus. Anna passed along the English Channel, where Elizabeth I sent her admirals, Charles Howard and William Wynter, to offer support and safe passage. They traveled through the Netherlands, where Anna was accosted by friends and relatives of Floris of Montigny, the younger brother of the executed Count of Horn. Floris had been imprisoned in Spain since 1567. Now that King Philip had entered into a new marriage, Floris' family and friends hoped for leniency. They received a promise from the future queen that she would do her utmost to free Floris; however she was unsuccessful, with Floris being strangled on the orders of the king. On 3 October Anna arrived on Spanish soil, but before she could reach the king, Floris was secretly put to death on 16 October 1570. The historian John Brewer believes that Philip had him hastily executed soon after Philip's first meeting with Anna, in which he refused to free Floris.
Queen of Spain
Upon her arrival in Spain, Anna was provided with a new household formed under the direction of the experienced and influential lady-in-waiting Margarita de Cardona, who had previously been the lady-in-waiting of her mother and who would have been known to her since her childhood in Austria. Queen Anna was described as vivid and cheerful, and managed to ease up some of the stiff atmosphere at the Spanish court. Anna busied herself mostly with needlework. The marriage between Anna and Philip is described as happy. Besides being her father's favorite child, Anna was reportedly also Philip's most beloved wife. According to diplomats, the king was in love with his young bride. There are no records of Philip having mistresses during the time of their marriage. Anna had a personality very much like his own, and he was devoted to her. Philip was a conscientious monarch and maintained his relationship with Anna twice a week in the form of notes, as well as visiting his wife's bedchamber up to three times a day. Anna gave birth to five children, including four sons, of whom the eldest three died before Philip, and the youngest eventually succeeded him as Philip III. Anna was also described as a good stepmother to Isabella Clara Eugenia and Catherine Michelle. In 1580 she was in Badajoz, where the court was briefly based because of Philip II's claim to the Portuguese throne. She died there of influenza, eight months after giving birth to her last child, Maria, who outlived her mother by less than three years. Anna was initially buried in Badajoz, but her body was later transferred to El Escorial.