For three years, Stein lived in the Austrian Empire, generally at Brno, but in May 1812, in danger of being surrendered by Austria to Napoleon, he received an invitation to visit Saint Petersburg from Emperor Alexander I of Russia, who saw that Austria was certain to be on the side of France in the forthcoming Franco-Russian War. At the crisis of that struggle, Stein may have been one of the influences that kept the tsar determined never to treat with Napoleon. When the miserable remains of the Grand Army reeled back into Prussia at the close of the year, Stein urged the Russian emperor to go on and free Europe from the French domination.