A man from the city of Ballarat in southeast Australia knew he was breaking the law last October when he reached into a car with its windows open and took two cellphones and a wallet.

But when he browsed the cellphones and found what appeared to be pornographic images of children, he knew turning himself in was a small price to pay to help police catch the man responsible for taking the photos, the Ballarat Courier reports.

The thief, whose name has been withheld for legal reasons, immediately took the phones to the nearest police station.

Though police told him he may be prosecuted for stealing the phones -- and would likely face charges for allegedly stealing a car last year -- the man agreed to turn himself in if it would help investigators track down and build a case against the child pornographer.

Indeed, the cellphone images allowed police to arrest and charge a 46-year-old man with a child pornography offense, Nine News MSN reported.

"I haven't seen anything quite like that and I commend the man for his admissions," Victoria Police Chief Commissioner Ken Lay told Fairfax Radio, according to the Australian Associated Press. "It's a strange old world, isn't it, when it comes to the world of crime.''

The cellphone thief appeared in Ballarat Magistrates Court on Tuesday and pleaded guilty to seven charges including theft of a vehicle. Upon learning how his surrender helped investigators, magistrate Michelle Hodgson praised the man for his actions.

"You did the right thing," she said, according to the Courier. "That kind of offending is very serious. You are to be commended for your conduct even though it placed you at jeopardy of losing your own liberty."

Hodgson ordered the man to serve one month in prison and pay a $400 fine, adding that the court would not want to "discourage other like minded people to act in the manner you have."