It was originally called "football" in Britain. Following the invention of "rugby football" the term "association football" was used to differentiate the two sports. Association football was often written as "assoc." and then became known as "soccer".
Due to the class and origins of most early American settlers, rugby was far more popular than football; so "football" came to mean "rugby football"; while "soccer" was used to refer to football.
Over time, the colonists adapted the rules of rugby and eventually codified them as American football.