AMMAN, Jordan — Jordan’s national census takers made something of a stark discovery earlier this year when they found that nearly a third of the country’s 9.5 million residents are not, technically speaking, Jordanians.

For decades, the country has absorbed successive waves of people fleeing war and chaos.

Lately it has been the Syrians, but before them came Iraqis, Sudanese and Palestinians, not to mention those from Egypt, and as far away as Pakistan and the Philippines, who have come to Amman to work.

They have made the once sleepy Jordanian capital an unlikely, unsung city of refuge for people ejected from their homes.

It has not always been smooth: Hundreds of thousands of Palestinians who came after the Arab-Israeli wars of 1948 and 1967 are now Jordanian citizens, but some of the more recent arrivals are not.