A Syrian refugee holds her baby next to a bonfire as she waits to cross the Greek-Macedonian border, near the village of Idomeni, Greece, January 21, 2016. REUTERS/Alexandros Avramidis

LJUBLJANA (Reuters) - Slovenia will keep out all migrants apart from those planning to seek asylum in Austria and Germany, Interior Minister Vesna Gyorkos Znidar told a news conference, adding the country would also strengthen border controls.

The announcement on Thursday came a day after its neighbor 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.

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 Alpine 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.