A woman who had sex with a 15-year-old friend of her cousin's has walked free from court after a judge found she had been motivated by "an unmet need for love and affection".

County Court judge Duncan Allen said on Monday he had agonised over what sentence to impose on the woman, 26, before deciding a jail term was not warranted.

Judge Allen said a psychological report revealed the woman was not a paedophile and was a low risk of re-offending.

Her offending had been caused by her long-standing poor self-esteem and feelings of being inconsequential and isolated when a single parent with a special needs child.

The woman, who pleaded guilty to two counts of sexual penetration of a child aged under 16 and one count of performing an indecent act in front of a child aged under 16 in July last year, was placed on a three-year community-based corrections order and must perform 200 hours of unpaid community work.