The State Border Service of Azerbaijan was established on July 31, 2002 by the order of the President of Azerbaijan Heydar Aliyev, by taking of the border troops from jurisdiction of the Ministry of National Security of Azerbaijan. The main function of the border guard is to guard the Azerbaijani borders against any illegal acts, and to prevent illegal weapons, drugs and human trafficking in the country. 