United Nations High Commissioner for Refugees Filippo Grandi visits a shelter for displaced Syrians in Jibreen, on the outskirts of Aleppo, Syria, Feb. 1, 2017. Reuters

The European Court of Justice, or ECJ, ruled Tuesday in favor of Belgium's decision not to grant a humanitarian visa to a Syrian family at its embassy in Lebanon, rejecting the advice of the court's top advocate.

The Syrian family of five from Aleppo applied for 90-day travel documents at Belgium's embassy in Beirut in October before ultimately returning to Syria, torn by six years of civil war that has killed hundreds of thousands and killed millions more. The family claimed they were targeted for their Eastern Orthodox beliefs and that one member was kidnapped and beaten by armed militants while the city was then under control by various rebel organizations attempting to overthrow Syrian President Bashar Assad. Less than a week after the applications were sent, Belgium's foreign office rejected them, saying the government felt the family intended to stay longer than 90 days.

After the family brought the case to the EU's top court, ECJ Advocate General Paolo Mengozzi called on the judiciary last month to compel Belgium to accept the applicants. Mengozzi argued that granting the visas were necessary under EU Law as the family was at particular risk and Belgium was bound to abide by the EU's policies.

The court, however, backed Belgium this week in a rare rejection of its adviser, stating, "Member States are not required, under EU law, to grant a humanitarian visa to persons who wish to enter their territory with a view to applying for asylum."

"Yes! We won!" Belgium's immigration minister, Theo Francken, tweeted Tuesday in response to the decision. "European Court of Justice is very clear: EU countries are not obliged to issue humanitarian visa under EU law," he added before thanking 13 EU member states and the European Commission for backing Belgium in the case.

The issue of refugees fleeing conflicts in the Middle East, North Africa and Asia has politically polarized European society, with some countries, such as Germany, opening their borders to asylum seekers and others, like the Balkans, closing themselves off entirely to migrants. The EU has attempted to take a liberal approach and apply these standards to all 28 of its member states, with the European Commission stating that all of its members "have a shared responsibility to welcome asylum seekers in a dignified manner." Right-wing populism and a series of major terror attacks, including the deadliest incidents ever in France and Belgium, have prompted some groups to seek legislation limiting access to the EU for refugees.

Among those fleeing their native countries, the number of Syrians has risen most sharply in recent years. The conflict in Syria began when massive anti-government protests transformed into an armed insurgency against the state. The insurgency was sponsored by the West, Turkey and Gulf Arab countries such as Saudi Arabia and Qatar, while the Syrian government was backed by Russia, Iran and various pro-government militias. While the opposition managed to capture large swathes of territory early on in the war, a series of factors including a decline in foreign support, infiltration by jihadists and a direct Russian intervention has allowed the Syrian military and its allies to regain strategic areas such as Aleppo and the ancient city of Palmyra in a push to defeat the rebels or negotiate a political surrender.