Slovenia will keep out all migrants apart from those planning to seek asylum in Austria and Germany, Slovenia's Interior Minister Vesna Gyorkos Znidar says, adding the country would also strengthen border controls.
The announcement on Thursday (local time) came a day after its neighbour Austria said it would restrict the entry of migrants.
"We will act in all directions so as to prevent Slovenia becoming a pocket for stranded migrants," Gyorkos Znidar said after a regular government meeting on Thursday.
Slovenia is the smallest country on the Balkan migration route. About 409,000 migrants have entered since October, when Hungary closed its borders and pushed the migrant route west through Slovenia.
So far almost all migrants have continued on their way to Austria and further on to northern Europe, but Austria said on Thursday it would restrict the number it would take in.
Slovenia has said it will have to follow Austria's example because the small state of 2 million people does not have the capacity to accommodate a large number of migrants.
Gyorkos Znidar urged the EU to reach agreement on stopping migrants on the border between Macedonia and Greece to prevent them continuing north through the Balkans.