If you have a residence permit in Sweden, you can travel out of Sweden and back for as long as your permit is valid. You must have a valid travel document (passport or travel document) and your residence permit card. If you will be travelling to a non-Schengen country, you may need an entry visa.
If you travel to your country of origin, your protection status may be revoked
If you have a residence permit in Sweden because you have protection status as a refugee or as a person in need of subsidiary protection, you should not travel to your country of origin or the country from which you fled. You risk having your protection status revoked if you travel to the country you have fled from, and to which you have said that you cannot return. The Swedish Migration Agency may then consider that you no longer need protection.
When the Swedish Migration Agency investigates whether your protection status should be revoked, we look at whether our previous assessment of your need for protection is affected by the fact that you have travelled to the country you have fled from. The reason why you travelled there and how long you stayed there may affect our assessment of whether your protection status should be revoked.