Mahathir, who was the country's longest-serving prime minister, in office from 1981 to 2003, remains an influential figure in Malaysian politics.
"The Internet has played a major role in undermining public morality," 89-year-old Mahathir said in a blog posting Friday, adding that "today any child can access pornography of the worse kind.
"I don't care how sacred is freedom but I think the time has come for governments, at least the Malaysian government to censor the Internet."
Mahathir pledged in the 1990s that the government would never censor the Internet, in a bid to lure high-tech foreign investment.
"Not knowing the power of the Internet, I promised that we (speaking then as the prime minister of Malaysia) would not censor it. But today I have changed my mind," he said.
Mahathir, an avid social media user, said Internet content was already censored.
"I myself have suffered from such censorship. When I put on my blog, an article on the Jews, without any explanation, my article was prevented from being linked to Facebook," he said.
Tony Pua, 42-year-old opposition lawmaker with the Democratic Action Party, told AFP that he supported "some degree of Internet control" against pornography but there should be no censorship of news or opinion pieces.
"Our concern is in Malaysia's case, such restriction of the Internet will be used by the ruling government to increase their stranglehold on power and to suppress the opposition's voice for the purpose of retaining power," he told AFP.
Malaysia's opposition is vocal on issues related to corruption, human rights abuses and crime.
Malaysia's Internet penetration is estimated at about 66 percent of the 30-million-strong population.