A teaching assistant accused of seducing a pupil more than 40 years her junior was caught after the boy showed indecent photographs of her to his friends, prosecutors have told a court.
Elaine McKay, 58, is accused of starting a sexual relationship with the 15-year-old while working at the 1,700-pupil Clacton Coastal Academy in Essex.
Opening the trial at Chelmsford Crown Court, prosecutor Richard Scott said McKay's behaviour breached her duty to "ensure the safekeeping and welfare of all children".
Mr Scott added: " They had perfectly consensual sex - the only problem was he was less than 16 at the time while she was in her late 50s.
"Although he was near the age of consent, he was not at the age of consent."
He described how McKay and the victim, who cannot be named for legal reasons, would regularly meet each other outside school.
Over time they became closer, culminating in them having sex on one occasion.
Mr Scott added the teacher sent him topless and explicit photographs, including one featuring a cucumber.
The relationship came to light when t he boy showed the indecent photographs of McKay stored on his phone to one of his friends.
The victim later told his friend that they had had sex.
Other pupils soon found out and the gossip reached parents, Mr Scott said.
The prosecutor added that on one occasion McKay performed a sex act for the boy over video messaging website Skype.
Unbeknown to her, some of his friends were also watching.
McKay, of Banister Close, Clacton, Essex, denies intentionally touching a boy aged 15 by having full sex with him and inciting a child to engage in sexual activity.
She has admitted causing a child to look at sexually explicit images.
Wearing a black suit jacket and white blouse , McKay seemed composed as details of the relationship were read to jurors.
The court heard that McKay accepts that there may have been some inappropriate behaviour between the pair but this never amounted to sexual activity.
On one occasion the boy sent a message reading: "You turn me on but I still think it isn't right."
Mr Scott said that after stories of the relationship began to emerge, McKay and the boy exchanged a series of messages in which they attempted to get their "story straight".
The trial is expected to last about four days.