The case of a 40-year-old Malaysian man who is charged with raping a 13-year-old girl before marrying her under sharia law has provoked national outrage.

The alleged rape happened in the eastern state of Sabah, where more than half of such cases involve underage girls, according to human rights activists.

Riduan Masmud, a restaurant owner, was charged with raping the girl, whom he had known for six months, in a parked car in February. He took her as his second wife – by mutual consent, he said – soon after that.

"There are many cases of men marrying underage girls," Masmud told reporters outside court. "I do not see why my case should be any different."

Masmud said he planned for the girl to finish her studies and then "take up a cosmetics course with my first wife". The wife told reporters she had accepted the girl as Masmud's second wife.

The girl's father claims Masmud had paid the family 5,000 Malaysian ringgits (£1,100) in compensation, and told reporters he accepted the marriage. "It is best for her that they get married," he said. "What else can I do?"

Human rights groups urged the government to press on with charges when the prosecution tried to drop the case after the marriage.

"This case is part of a worrying trend in which older men proposed marriage after being charged with statutory rape to circumvent the mandatory provisions of the penal code," Mary Lee, of Sabah's Action Resource Group, told the Star. "The state cannot be seen by the public to condone such action by letting off the accused under the guise of marriage."

The state minister of community and consumer affairs, Datuk Jainab Ahmad, said her ministry was "questioning the validity of the marriage", and that she had told Sabah's welfare services department to put the victim under protection.

"As a mother, I am still puzzled: how could the father or the girl allow his daughter to be married to the man who had raped her?" Ahmad asked.

"The girl was only 12 years and six months. I believe the victim is in a trauma. She should be protected instead [of] marrying the man who had raped her."

The Malaysian anti-corruption commission is investigating the claims that Masmud paid the family.