ISTANBUL — After maintaining an open-door policy throughout the four-year conflict in neighboring Syria, Turkey has moved this month to close the two remaining border gates between the countries, shutting out displaced Syrian refugees amid fears of a potential terrorist attack.

The Oncupinar and Cilvegozu border gates in Hatay Province were initially closed on March 9 as a precaution against clashes that intensified in northern Syria. But while trucks carrying aid and authorized trade have since been permitted to cross from Turkey into Syria, the gates have remained closed to individuals trying to cross into Turkey for over two weeks, including Syrian citizens carrying passports.

“Many Syrians are stuck inside and outside,” said Abdo Falouti, a father of five who has lived in Turkey for three years. “My mother went in a few weeks ago to renew her passport but has not been able to come back to us.”

The closing of the gates has underscored the conundrum Turkey faces as it tries to balance a commitment to taking in refugees with security and pressure from Western allies to tighten its borders. So far, Turkey has taken in almost two million refugees from Syria, making it the country hosting the most refugees in the world, according to the Office of the United Nations High Commissioner for Refugees.