A former West Australian police officer has been sentenced to two years in prison for having sex with an underage girl.

Dean Tapper, 46, pleaded guilty earlier this year to three charges of having sex with the 15-year-old in 2012.

He claimed he honestly believed she was 19 because that was what she told him.

At the time of the offences, Tapper was a senior constable with the East Metropolitan District, but he was stood down after being charged and later resigned from the police service.

Tapper met the girl through an online dating website that required participants to be over 18, but the girl lied about her age.

He arranged to meet and have sex with the teenager on two occasions. Both times she was wearing her school uniform, and he once picked her up at the library that was attached to her school.

Tapper argued he had an "honest and reasonable" belief the girl was over the age of the consent, and said he asked her "about a dozen times" and she repeatedly told him she was 19.

However District Court judge Patrick O'Neal said he was "not satisfied" Tapper did "honestly believe" the girl was over the legal age.

"You were highly doubtful ... your state of mind was, at best, wilful blindness," Judge O'Neal told Tapper.

"Given your doubts, you could have abstained from having sex with her, or you might have sought out an adult partner."

Tapper told the court he had asked the girl to show him her driver's licence, but Judge O'Neal rejected his evidence.

"Apart from repeatedly asking her age, you did nothing," he said.

Judge O'Neal said he did not believe Tapper was at risk of reoffending, but he said the offences were so serious an immediate jail term was required.

"The fact there are two occasions [of offending] shows a degree of persistence, despite your obvious and understandable doubts," he told the court.

Tapper will have to serve one year in prison before he can be released.