 In 1810 General Mikhail Barklay de Tolly organized numerous border posts along the entire western Russian border, manned by 11 regiments of Don and Bug Cossacks .Within two years Russian Border Guards became the first to oppose Napoleon's invasion of Russia (June 1812).In 1832 Cossacks and cavalry were replaced by armed customs officials subordinate to the Ministry of Finance in peacetime (in wartime the border guards were automatically transferred to the army).