A Malaysian court on Monday sentenced a Danish citizen to a week in jail after he pleaded guilty to maliciously publishing false information, the first person to be punished under a controversial anti-fake news law.

The legislation was approved by parliament earlier this month despite criticism that it was aimed at silencing dissent ahead of a May 9 general election. It carries a maximum penalty of six years in jail and a fine of 500,000 ringgit ($128,000).

Salah Salem Saleh Sulaiman was detained April 23, two days after he claimed in a YouTube video that he was with a Hamas scientist who was gunned down in Malaysia by two assailants on a motorcycle. Salah claimed he made countless calls to police who were slow to respond, and that an ambulance came an hour later.

Local media said Salah didn't personally know the victim, Fadi al-Batsh, a Palestinian electrical engineering lecturer in Malaysia who was a member of Gaza's ruling Hamas group.

The court sentenced Salah, who is of Yemeni descent and is in Malaysia on a holiday, to a week in jail from the day of his arrest and fined him 10,000 ringgit ($2,550).

Local media quoted Salah, who was not represented by a lawyer, as telling the court that he had only been in Malaysia for 10 days and didn't know the country had an anti-fake news law. He said his action was a mistake and apologized.

Salah reportedly said he didn't have money to pay the fine and will have to serve another month in jail instead.

