Simon Thomas has quit as a Welsh Assembly Member after being arrested by police investigating allegations of possession of indecent images.
The Plaid Cymru Mid and West Wales AM, a 54-year-old married father-of-two, has also quit the party.
Mr Thomas, who was MP for Ceredigion between 2000 and 2005, has deleted his Twitter page and personal website.
Dyfed-Powys Police said an “individual from Aberystwyth” had been released on bail for 28 days.
A statement from the force said an arrest had been made “on suspicion of possessing indecent images”.
The assembly’s Presiding Officer Elin Jones confirmed Mr Thomas’s resignation in a statement at about 10:00 BST on Wednesday, saying “the Llywydd has received a letter of resignation from Simon Thomas with immediate effect”.
Asked if police had searched his office in Cardiff Bay, a spokeswoman for the Assembly Commission, which is in charge of the day-to-day running of the institution, said: “We are co-operating with the police and have no further comment to make.”
Plaid Cymru chairman Alun Ffred Jones said the party was “aware of a police investigation into allegations of a serious offence”.
He added: “Due to that ongoing investigation it would not be appropriate to comment further at this time.”
Mr Thomas, a former librarian who lives in Aberystwyth, was a special senior advisor to former deputy first minister Ieuan Wyn Jones after losing his seat at Westminster and before he was elected to the assembly.
He was also a contender to succeed Mr Jones as party leader in 2012, but dropped out of the contest which was won by Leanne Wood.
The resignation of Mr Thomas will not trigger a by-election as he was elected via the regional list system, where voters choose a party rather than a specific candidate.
When a regional AM resigns, they are usually succeeded by the person who was next on the list for their party at the previous assembly election in that particular region.
Former AM Helen Mary Jones, who was next in line on the Plaid list in the region, will now decide whether she wants to replace him.
The 58-year-old was an AM between 1999 and 2011, firstly representing Llanelli and then the Mid and West Wales region.
Ms Jones, who now works at Swansea University, said on Twitter she was “in something of a state of shock”.
“I have now got some big decisions to make in the next few days,” she added.