The U.S. government has a sneaky pre clearance mechanism in place by way of the PISCES system that has been forced on several countries around the world.
Immigration officers in these countries feed information of all incoming and exiting passengers and take their picture (on arrival and at the time of exit). The information is then sent to a central server in the U.S. where each passengers details are checked against a list of people the U.S. government does not like.
I know of about 10 countries that have Pisces installed.