It counts as an attack, but how close was US to actually being taken over? Usually when you fight a war the real risk is that you cease to exist as a country. I know nothing about war strategy, but seems to me US is in a great position as long as you get along with Canada and Mexico.
If they think conflict is inevitable then they may well feel they will get an upper hand by moving first.