Globally, we are witnessing a resurgence of chest-thumping in the name of the nation.

In the United States, it has been President Trump’s call to “Make America Great Again.” In Britain, Brexit promised to “take back” the country from the European Union. Nationalist parties also have made unprecedented gains in other parts of Europe. The rise of stridently nationalist leaders such as Xi Jinping in China and Narendra Modi in India are further examples of the wave of nationalism that seems to keep swelling.

This trend is worrying for most scholars. This is because nationalism has time and again demonstrated its power to produce evil in the world. From world wars, holocausts and pogroms to chauvinism, jingoism and xenophobia — the list of horrors associated with or committed in the name of nationalism is as long as it is tragic.

And yet research shows that there are reasons to be a nationalist

In my book, “How Solidarity Works for Welfare: Subnationalism and Social Development in India,” I argue that the destruction that nationalism has brought in its wake should not prevent us from recognizing its constructive potential.

This is because national attachment is central not just to the functioning of political institutions but also to the very structure of society. At the individual level, nationalism fulfills a basic psychological need to belong — it gives people a sense of security and status.

At the social level, it fulfills the essential function of consolidating the group and its identity above and beyond individual needs. Nationalism has (too) often been a force for exclusion, discrimination and violence, but it also has been a vehicle for greater freedom and well-being.

Nationalist movements against colonial rule paved the way for the institution of sovereign and, in most instances, democratic regimes across Asia and Africa. Across Europe, the national solidarity engendered by World War II was a key driver for the institution of radical and unprecedented “cradle to the grave” social policies including education, health and housing that were made freely available to all citizens irrespective of their ability to pay for them.

The National Health Service in Britain is often cited as a classic instance of such a social welfare institution. The NHS was established because of the emergence of a sense of British identity that cut across class and other divisions in the postwar years. But the NHS itself has been an important source of sustaining and strengthening this identity.

The establishment of the NHS in 1948 coincided with the end of British colonial rule across Asia and Africa, and the available-for-all, paid-for-by-all health service gradually replaced the empire as a symbol of British identity. In a survey conducted a few years ago, the NHS was voted the main source of national pride, beating both the army and the monarchy to take the top spot.

There’s a similar pattern in the United States

In the United States, historically the establishment of some the most progressive social policies — during the Progressive era around 1900, the New Deal in the 1930, and the Great Society in the 1960s have all been predicated on the existence of a strong national “we.”

This might suggest a reframing of the problem today. It’s not so much the surge of national loyalties but the narrow, exclusive way in which ideas of “the nation” are constructed. Nationalism across the globe is coming to be associated with the beliefs and ideologies of a particular, dominant group — for example, “white nationalism” in the United States or “Hindu nationalism” in India.

And yet U.S. nationalism need not be white nationalism, just as Indian nationalism is by no means equal to Hindu nationalism. Indeed at various points in U.S. history, the sense of nationalism has been a positive force.

Some might argue that to quell jingoistic “ethnic” nationalism means denouncing the concept of nationalism itself. And yet giving up on nationalism implies relinquishing control over the content and boundaries of this powerful affective identity.

Research suggests that an inclusive, solidaristic sense of nationalism might help us attain those very goals — freedom, equity, welfare — that are most endangered.

Prerna Singh is Mahatma Gandhi Assistant Professor of Political Science and International and Public Affairs at Brown University. She is the author of “How Solidarity Works for Welfare: Subnationalism and Social Development in India (Cambridge University Press, 2015).