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.
As the eldest daughter of the Holy Roman Emperor, Anna was a desirable candidate for marriage at the European courts. Her parents thought of a Spanish marriage to strengthen links between the Austrian and Spanish Habsburg families. Initially she had her cousin Don Carlos of Spain in mind, 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, died in childbirth, also in 1568. As a result, Philip was left a widower with two young daughters. Philip had been married three times before: first to his double first cousin Maria Manuela, Princess of Portugal, secondly to his first cousin, once removed Mary I of England, and thirdly to the aforementioned Elisabeth of Valois. Philip was now looking for his fourth wife, since he had no male heir since Don Carlos died. 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 Wenzel. 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. Montigny had been imprisoned in Spain since 1567. Now that King Philip had entered into a new marriage, Montigny's family and friends dared to hope for leniency. They received a promise from the future queen that she would do her utmost to free Montigny; however she was unsuccessful, with Montigny 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.
Besides being her father's favorite child, Anna was also Philip's most beloved wife. But the marriage was at first opposed by many, including Pope Pius V. According to diplomats, the king was in love with his young bride. Philip was a conscientious monarch and maintained his relationship with Anna twice a week to write notes. It was Philip's fourth marriage, but the king still had no male heir. Anna completed her duties flawlessly in that regard. Not only was she a good stepmother to Philip's daughters Isabella Clara Eugenia and Catherine Michelle, but she also gave birth to five children, including sons.
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. Queen Anna was also vivid and cheerful, and managed to ease up some of the stiff atmosphere at the Spanish court. Anna busied herself mostly with needlework.
She died of heart failure eight months after giving birth to her last child, Maria who outlived her mother by less than three years.