A Perth school teacher has pleaded guilty to child sex offences committed against a 14-year-old boy.

The teacher, who cannot be named for legal reasons, was due to stand trial in the Perth District Court on Tuesday charged with three counts of engaging in sexual behaviour with the teenager, but changed her plea at the start of the trial.

The offences allegedly happened in 2009 after she developed a friendship with the boy.

She is due back in court on July 4.