BERLIN — A German mother and her partner were convicted and jailed Tuesday for repeatedly raping the woman's young son and selling him to pedophiles on the internet, abusing him for more than two years in a case that has horrified the country.

The Freiburg state court in southwestern Germany convicted the couple of serious sexual abuse of children, 21 counts in his case and 19 in hers. They also were convicted of rape, human trafficking for the purpose of sexual exploitation, forced prostitution and producing child pornography, among other offenses.

The 48-year-old woman, who has been identified only as Berrin T. in line with German privacy rules, was sentenced to 12½ years in prison. Her partner, Christian L., was sentenced to 12 years. The court ruled that the man, who had a previous conviction for child sex offenses, must remain in preventive custody after serving his sentence.

The pair were convicted of repeatedly abusing and raping the boy, now 10, and selling him to men on the darknet, an area of the internet that can be visited only by using special software. Some of the abuse was filmed.

The pair and six others were arrested last September. Several men have already been convicted in separate trials.

The court said the pair met at a food bank in Staufen, near Freiburg, in late 2014. It said the mother was aware from the start of the man's pedophile tendencies and previous conviction.

In the following months, the court said, the woman organized assaults on a 2-year-old girl she occasionally looked after. In May 2015, the couple started abusing the woman's son, with the man at first offering the child cash.

The couple allowed four other men to sexually abuse the boy — among them a German soldier, a Swiss man and a Spaniard who admitted paying the couple 10,000 euros ($11,560) to rape the boy multiple times and was convicted in a separate trial Monday.

The mother was often near the scene of the abuse by other men "to exert a calming influence on her child," and in the case of one client participated herself, the court said. The verdict was based on confessions by the pair and the videos of the abuse.

In Tuesday's verdict, the couple was ordered to pay a total 30,000 euros ($34,650) in compensation to the boy and 12,500 euros to the girl they abused previously.

Local authorities have been accused of failing to protect the boy, who now lives with a foster family.

Officials took the boy away from his mother in March last year following vague indications from police that he might be at risk, but a local court sent him back weeks later on condition that she not allow any contact between the child and her partner.

Police started investigating after receiving an anonymous tip in 2017.