In Islam the concept of loyalty is clear and simple. In the Holy Quran, it is to ‘…obey those who are in authority over you…’ While the Holy Prophet of Islam, advocated that; ‘…Obedience to the law of the land is a part of faith.’
With these key principles in mind it is clear that Muslims are duty bound to be loyal to the country in which they live. It is critical to note that this did not come with any precondition of the country being an Muslim or Islamic country, it is a principle that applies to any country no matter what form of government it has. Similarly there is no requirement of the country having a legal system based on Islamic Shariah law.
It is also pertinent to note that if Muslims are denied their rights to worship God and practice their faith then whilst they have the right as citizens to advocate for such rights, even in such instances the principle of loyalty is not compromised. In extreme cases where there are prohibitive conditions for Muslims to practise their faith and possibly where they are persecuted because of their faith then Islam still holds fast to the principles of peace and advises Muslims to migrate from such places and move to other countries where they can practice their faith. This was the example of the Holy Prophet ( peace and blessings of God be upon him) who was bitterly persecuted in Makkah for 13 years before he migrated to Madinah. There was no call for uprising or dissent but an adherence to the principle of peace.
So for Muslims loyalty to ones country is a key part of their faith and it should serve as a source of peace for them and their fellow citizens.