9/11 was by far the worst terrorist attack in American history with 2,977 victims (excluding the 19 perpetrators). While the attacks were aimed at the United States, 372 foreign nationals from 61 countries were also victims.
Here’s a list of casualties by country based on data from Wikipedia: