Her life changed the day Paul cast an eye on her during a ball in 1796. His tenderness towards the girl was noted by a court faction which hoped to use her as a remedy against the influence of the Empress Maria Feodorovna. The Emperor was told that the girl, hopelessly in love with him, was on the verge of killing herself on that account. When Paul ordered her family to be brought to Saint Petersburg, the Empress ineffectually attempted to interfere and sent an angry letter to Lopukhina pressing her to stay at home. The letter was intercepted and presented to the emperor in the most unfavourable light, thus sparking a quarrel between the spouses and ensuring Lopukhina's ascendance at court.
After Anna was brought to the capital, the Emperor appointed her father General Procurator and made him Prince with the title of His Serene Highness. Anna herself was showered with awards, including the Order of Saint John. On Paul's urging, the translation of her Hebrew name – "grace" – was given to warships and inscribed on the standards of the imperial guards. All things considered, Lopukhina's influence on the tsar's irascible character is reckoned to have been beneficial, although the Emperor's constant attention seemed to importune her so much that in 1799 she asked his permission to marry a childhood friend, Prince Pavel Gagarin. After the sovereign acquiesced, Gagarin was recalled from Alexander Suvorov's army then fighting in Italy and the wedding took place on 11 January 1800. The marriage was also to protect her from public spite.