Troops from the European Union or NATO will be allowed to help defend Hungary's borders due to the migrant crisis, the Hungarian government said Thursday.

A government decree said up to 1,000 troops from Hungary's allies can take part until March 15 in the "Common Will" border defense operation. Their tasks may include participating in joint exercises as well as supporting Hungarian troops on the border, but they will not be directly policing the border.

Some 4,700 Hungarian soldiers are now at the country's southern borders with Serbia and Croatia.

"Hungary's plan is to defend its border with Croatia from the pressure of illegal migration, together with the V4 countries," said Janos Lazar, Prime Minister Viktor Orban's chief of staff.

The V4, or Visegrad Group, includes Hungary, Poland, the Czech Republic and Slovakia.

Hungarian Foreign Minister Peter Szijjarto, speaking after a meeting in Luxembourg of EU interior and foreign ministers, said the Visegrad Group had agreed to help Hungary with border defense.

The Czech Republic is sending 25 soldiers by Oct. 15, while Slovakia has offered to send 50 police officers.

Zsolt Nemeth, head of Parliament's foreign relations committee, saw nothing unusual about EU countries sending troops to guard a border with another EU country.

"The EU has to be able to defend border sections which some countries can't protect from migrants," Nemeth told The Associated Press.

Over 330,000 migrants have entered Hungary this year. Hungary has put up a razor-wire fence on its border with Serbia and Lazar said a similar barrier on the Croatian border was "99 percent complete."

Lazar said a decision about when to close the Croatian border to migrants would be made after talks over the next week with Austria, Germany and other countries.