Nationalism in the sense that it is understood today is a relatively new concept. While nationalists in the nineteenth century attempted to find common cultural elements among people that dated far back into the past, ancient, medieval, and early modern peoples did not conceive of national belonging in the same ways. This is not to say that the concept of "nations" as such did not exist previously, but most scholars tie the birth of nationalism to the downfall of the Napoleonic Empire in Europe in the early nineteenth century.
Nationalism became an ideology of liberation, one which united people bound by a common language and perceived cultural history. It was advanced by intellectuals and revolutionaries, often with the goal of achieving independence from larger empires, especially in central Europe. As the century went on, nationalists began to define nationhood in exclusive terms, framing their nation as an entity in opposition to an "other." Increasingly, ethnic minorities, including Jews, were viewed as foreign, though they may have lived in an area for centuries. In the United States, this view was behind attempts to restrict immigration, such as the Chinese Exclusion Act of 1883.
The nineteenth century also saw the rise of print media, which tended to not only promote a common culture, but served to normalize a particular language. So the rise of nationalism was inextricably tied to print and other modern media. Nationalism would receive its most virulent formulation in the rise of European totalitarian dictatorships in the 1930s. It would again become a powerful force for liberation in the second half of the twentieth century, as former colonies like India achieved nationhood. This was the other way in which colonialism can be imagined as a modern development.