Hungary's parliament on Tuesday approved the automatic detention of all asylum-seekers in container camps at the country's southern borders, brushing off concerns from rights groups.

The legislation, approved by a large majority of lawmakers, is in response to recent terror attacks in Europe carried out by migrants, according to hardline Prime Minister Viktor Orban.