The law that gave the President the right to imprison or deport citizens of other countries was called the Alien and Sedition Act and was signed into law in 1798 by John Adams. The government could imprison, or deport, any foreign citizen that was deemed dangerous, or criticized the government.