Hungary declared a state of emergency on Tuesday due to the migrant crisis in Europe, according to USA Today.

Declaring a state of emergency allows the army to be deployed to patrol borders. This also gives the military the ability to assist the Hungarian police in dealing with the immigrants coming into Hungary on a daily basis. New border laws went into effect as of midnight Tuesday.

Now, it is against Hungarian law to cross or damage the border fence that separates the country from Serbia. A crossing point along the rail track has been sealed. Just on Monday, almost 10,000 migrants entered Hungary. This beat the previous record of 5,809.

Europe has recently been flooded with immigrants from the Middle East. Many are fleeing Syria, a country ravaged by terrorism and civil war, according to The BBC. Now, crowds of migrants are gathering along the razor-wire fence that is keeping them from getting into Hungary.

Elsewhere in Europe, 22 people drowned to death earlier on Tuesday. They were attempting to get into Greece by boat, and the vessel sank. Another 249 people were rescued from the disaster.

Migrants who break the law by getting into Hungary illegally face criminal charges that could lead to jail time or deportation. Police busses will take applicants to registration centers so they may enter Hungary, and the European Union, legally. If applicants are refused, however, the migrants will be taken back to Serbia, The BBC reports.

Hungary also plans to erect a new fence along the Romanian border, according to The Wall Street Journal.