A woman who slept with an underage boy will be detained at home so she can care for the child they had together, and others of her own.

In the Timaru District Court on Friday, the 34-year-old mother of four was sentenced to serve 10 months' home detention and ordered to have counselling or treatment after having unlawful sex with the teenager over a period of three months in 2008, beginning when he was 15.

The boy was staying with the woman and her husband for mentoring after displaying behavioural problems. But the woman grew to view the boy as a confidante and the pair later had sex.

When asked by the police about the sex that took place, the boy told them: "Of course I was into it."

"The law says no matter how enthusiastic the young man might be, it's illegal," said the woman's lawyer, Wayne van Vuuren.

"While she is very sorry for her offending, that is tempered of course ... by virtue of the fact that she has a baby with this young man.

"It hasn't set this young man up for a fall. It just means he has to be responsible in some way for his actions as well, further down the track."

Judge Brian Callaghan said the child was welcomed by the woman and there was no suggestion she was a bad mother.

The boy largely lived with the woman and her children after she separated from her husband and left her family home in July, 2008.

The unlawful sex continued until September, and she maintained a relationship with the boy until he later allegedly assaulted her.

Judge Callaghan said he took the woman's childcare responsibilities and personal circumstances into account in sentencing her to home detention.

Crown prosecutor Tim Gresson said that normally a crime like this would result in imprisonment.

"As a matter of principle, there should be no difference between the sentencing of a male offender for this type of conduct, and the sentencing of a female offender."

A report from victims in the case referred to the woman being very controlling and that "she seems to have an attraction to young teenage boys".

But Mr van Vuuren said: "This is not a woman from whom society requires protection. This woman is not a sexual predator. She does not have an unhealthy predilection towards inappropriate sexual contact with underage boys."

Child Youth and Family had considered the woman's situation and found no evidence she was a risk to her own or other children.

When she had the relationship with the boy, she was not thinking clearly. The relationship began three months before the boy turned 16, when the relationship would have been legal.

"She should have been the adult," Mr van Vuuren said. "She should have nipped this unhealthy relationship in the bud before it went to the extent it did."

The woman's name was permanently suppressed to protect her family.