A Queensland police officer was so focused on his crime-fighting role that he broke the law himself, a court has been told.

A police officer who gave confidential information to a private eye was so focused on fighting crime that he committed one, a Brisbane court has been told.

David O’Neill was a serving senior constable when he and his wife Miranda, also a former officer, gave her private-eye relative police information about criminals.

They ran police checks on people, businesses and vehicles, and gave the information to Miranda O’Neill’s brother-in-law Jon Robinson, who used it in his surveillance work.

The trio were sentenced in the Brisbane Magistrates Court on Monday for multiple counts of using a restricted computer without consent, and misconduct in relation to a public office.

Defence barrister Alastair McDougall said O’Neill, 54, had been a police officer for 31 years and his wife, 41, had also been a career police officer.

He said O’Neill had spent his life fighting crime and was so focused on it that he’d accidentally overstepped his own legal limits.

“I think that when he was helping Mr Robinson he thought he was involved in uncovering criminal activity,” Mr McDougall told the court.

“I think the focus on uncovering criminal activity impaired his ability to appreciate the limits of his role in fighting crime.”

He also said the O’Neills hadn’t been paid anything by Robinson and all three had lost their jobs as a result of their actions.

“They received nothing out of this. All they’ve got is a lifetime of dread and a lifetime of regret,” Mr McDougall said.

Magistrate Wendy Cull said that while there was no financial gain for the O’Neills, their offences were extremely serious.

She said at the heart of the matter was that they had broken the law and tried to justify their actions.

“The conduct of Mr and Mrs O’Neill … does strike at the foundation of policing,” she told the court.

“Ultimately this conduct can be described as the thin edge of the wedge of the bending the rules, but its seriousness cannot be understated because if police officers justify any bending in the rules to achieve outcomes, then public confidence in the system is lost.”

She sentenced O’Neill to six months in prison, wholly suspended, with an operational period of 15 months, and placed his wife on a two-year probation order.

Robinson was ordered to do 240 hours of community service and 18 months probation.