 On 15 February 1919 he was on leave from the military, but returned in May as commander of the 6th Battalion of the guards regiment in Munich and from 30 May as head of the "Education and Propaganda Department" of the General Command von Oven and the Group Command No.4 (Department Ib) under Lieutenant-General von Möhl.In his capacity as head of the intelligence department, Mayr recruited Adolf Hitler as an undercover agent in early June 1919.