The Slovenian army will be sent to guard the border with Croatia and help police control the flow of migrants into the country under legislation passed by parliament late on Monday.
The act giving the army the power to control the migrant flow was passed by 69 votes to five, parliamentary speaker Milan Brglez said.
Prime Minister Miro Cerar told a news conference ahead of the parliamentary session that the army would be assigned to the border duty for three months only.
"This will be no military action [of the army]. The army will just help police in guarding the border and direct migrants who may want to cross the green border into the reception centers," Cerar said. Numbers of soldiers helping police will depend upon the size of migrant flows.
Slovenia's move follows an announcement by its northern neighbor, Austria, that it will limit the inflow of migrants into the country.
Since October, when Hungary sealed off its border with Croatia and pushed the migrant wave west to Slovenia, about 474,000 migrants have entered Slovenia on their way to Austria and other northern European states.
Slovenia, with two million citizens, is the smallest country on the Balkan migrant route. Interior Minister Vesna Gyorkos Znidar said earlier on Monday the country would do everything to prevent it from becoming a bottleneck for migrants.