Afghanistan served as a buffer between the British and Russian empires until it won independence from British control on August 19th of 1919 .