Abdenacer Ardjoun, a lawmaker from the ruling National Liberation Front (FLN), had been detained earlier this month for attempting to smuggle an envelope to his daughter containing answers to the maths exam.

But he miscalculated -- as did the local police chief he hired to deliver it, and who was imprisoned for attempted fraud and "abuse of office".

The examiner overseeing the test reported them both.

A court in El-Oued, some 650 kilometres (400 miles) south-east of Algiers, handed down the ruling. Under Algerian law, parliamentarians' immunity only extends to activities related to their work.

Cheating has boomed in Algerian school exams in recent years, pushing authorities to take tough measures such as widespread internet shutdowns during exam periods and penalties of up to 15 years in prison for leaking exam topics.

Last year, 31 people were jailed for between six months and three years for high school exam fraud.