James Dorrin Hayward has pleaded not guilty to four offences relating to the alleged abuse of an eight-year-old girl.
Prosecutor Sean Stocks on Monday said the 53-year-old made the girl indecently touch him on three occasions at two homes while putting her to bed.
Hayward is also accused of showing the child how to search for pornography on the internet before her family discovered the alleged offences and reported them to police.
The District Court in Perth heard that after Hayward learned about the allegations he sent an email to his wife, in which he admitted the accusations.
Hayward resigned from the WA Nationals after the charges were laid in 2021 but continued to sit in the state's upper house as an independent.
His lawyer Tom Percy KC said there was a "serious doubt over the child's honesty".
He also said the email was a poor decision made during a stressful time in his life and not an admission of guilt.
Mr Percy said there was no medical or other physical evidence that shows his client is guilty of the crimes.
He also said Hayward's wife had previously warned him not to get too close to the child for fear an allegation could be made against him.
The trial continues.
1800 RESPECT (1800 737 732)
National Sexual Abuse and Redress Support Service 1800 211 028
Lifeline 13 11 14
beyondblue 1300 22 4636