During this time, he also translated works by socialist theoreticians such as Ferdinand Lassalle, Karl Kautsky and August Bebel to Estonian.
Rei participated in the Russian Revolution of 1905, taking part in the organization of an uprising at the cruiser Pamiat Azova in July 1906 and operating as an underground activist in Narva.
During World War I, Rei served as an artillery officer at the Peter and Paul Fortress in Saint Petersburg in 1914–1917.
After the end of the German occupation of Estonia in September 1918, Rei was appointed Minister of Labour and Social Welfare in the Estonian Provisional Government.
After a government reshuffle in February 1919, Rei served as a legal advisor in the Ministry of Labour and Social Welfare.
Following the June 1940 Soviet invasion and occupation of Estonia and the other Baltic states, Rei escaped from Moscow to Stockholm through Riga.