The former auditor general for Wales has pleaded guilty to possessing more than 100 indecent images of children.
Jeremy Colman, aged 62, was arrested in February on indecent images charges.
He was remanded in custody after admitting 14 separate offences connected with possessing and making indecent images of children.
His admissions came as he was due for trial at Cardiff Crown Court, having previously denied all allegations.
The charges originally related to possessing and making 429 indecent images of children between October 2008 and January 2010.
His guilty pleas came after the prosecution agreed to reduce the overall number of images to 182.
Colman also admitted a charge of failing to disclose a password to allow police to access information on a USB memory stick.
Colman has a home in Dinas Powys, Vale of Glamorgan, but had been living at Orton Longueville, near Peterborough in Cambridgeshire.
His barrister Wendy Hewitt asked for Colman to be granted bail as the judge adjourned proceedings to 19 November for pre-sentence reports to be prepared.
Cardiff Recorder Nicholas Cooke QC refused the request.
In a statement issued after the hearing Colman's former employer, the Wales Audit Office, thanked South Wales Police for their assistance and said: "This has been a difficult period.
"Thanks to our new auditor general and the professionalism and hard work of staff, we have been able to move forward as an organisation.
"We remain committed to providing a first class audit and review service for citizens in Wales."