An Indonesian MP who helped pass a tough anti-pornography law has resigned after being caught watching sexually explicit videos on his computer during a parliamentary debate.

A photographer saw the man, a member of the staunchly Islamic Prosperous Justice Party, gazing at the porn sites last Friday.

The blurred images have been published on the front pages of newspapers and commentators said the MP, who has uses the single name Arifinto, should be prosecuted under the terms of the law which he helped pass.

Arifinto, 50, has apologised to his constituents and said he is stepping down from parliament immediately.

"It's my decision," said the father of five, insisting he was not acting on the orders of his party. "Nobody tried to coerce me."

Indonesia, with a population of 237 million people, has more Muslims than any other country in the world. Although most are moderate, a small extremist fringe has become more vocal in recent years. They have pushed through several controversial laws, including the pornography law.

The law calls for prison terms of up to 15 years and fines for everything from kissing in public and exposure of a woman's "sensual" body parts to displaying "erotic" artworks. Broadcasting, possessing and storing pornographic material also is prohibited.

Arifinto, who oversees a parliamentary commission dealing with transportation, telecommunications and rural development, was an outspoken supporter of the law. He was caught watching the video clip for several minutes as fellow legislators debated plans to build a new parliament building.

The anti-porn law was used in January to sentence Nazril "Ariel" Irham, lead singer of the country's most popular band Peterpan, to 40 months in jail after two home-made sex tapes found their way to the internet

The editor in chief of Playboy Indonesia was last year sentenced to two years behind bars.

PA