Hungary plans to build a fence to keep migrants out along part of its border with Romania in addition to the barrier being erected along the frontier with Serbia, Foreign Minister Peter Szijjarto said Tuesday.

"The government has decided to make preparations for the construction of a fence on the Hungary-Romania border, extending from the border triangle of Hungary, Serbia and Romania, for a reasonable distance," Szijjarto told a press conference in Budapest.

"The measure is necessary as people-smugglers may change their routes because of the existing fence on the Hungary-Serbia border, hence a part of the immigration pressure may get directed towards Romania," he said, according to state news agency MTI.

Hungary is a member of the European Union (EU) and the passport-free Schengen zone.

Romania is in the EU but not in Schengen, while Serbia is in neither.

Hungarian authorities on Tuesday effectively sealed the border with Serbia, blocking a gap in a razor-wire barrier where many of the migrants passed through, as well as two official border crossing points.

The fence four metres (13 feet) high being built in addition along its entire 175-kilometre (120-mile) border with Serbia is due to be completed by the end of October or early November, the government says.

The measures are part of Prime Minister Viktor Orban's strategy to stem the flow of migrants -- more than 200,000 so far this year -- travelling from Greece through the western Balkans and into the EU country, most of them on their way to Germany and elsewhere in the 28-member bloc.

In addition, new laws came into force on Tuesday punishing "illegal border-crossing" with prison terms of up to three years, and the government also intends to deploy the army.

Hungary's response to the influx has been sharply criticised, with the UN refugee agency saying that criminalising people for crossing the frontier illegally could be in violation of the 1951 Refugee Convention.

French Foreign Minister Laurent Fabius has said that the fence being built along the Serbian border does "not respect Europe's common values."