Ancient warfare is war as conducted from the beginnings of recorded history to the end of the ancient period. In Europe and the Near East, the end of antiquity is often equated with the fall of Rome in 476. In China, it can also be seen as ending in the 5th century, with the growing role of mounted warriors needed to counter the ever-growing threat from the north. In India, the ancient period ends with the decline of the Gupta Empire (6th century) and the beginning Islamic conquests from the 8th century. In Japan, the ancient period can be taken to end with the rise of feudalism in the Heian period. The difference between prehistoric and ancient warfare is less one of technology than of organization. The development of first city-states, and then empires, allowed warfare to change dramatically. Beginning in Mesopotamia, states produced sufficient agricultural surplus so that full-time ruling elites and military commanders could emerge. While the bulk of military forces were stillfarmers, the society could support having them campaigning rather than working the land for a portion of each year. Thus, organized armies developed for the first time.