Riot police and soldiers have been deployed and border crossings are closed to prevent foreigners from joining anti-government protests.