Passing orders on a petition by the Special Investigation Division of CB-CID probing the murder, seeking custody of Shajahan, Fourth Judicial Magistrate Vijaylakshmi granted two days custody.
Shajahan, the assistant Muthavali of a mosque here, was arrested on August 3 under the Arms Act after police seized weapons like swords and knives from his house.
Police said he was also facing several cases, including murder, and had been detained under the stringent Goondas Act.
SID, set up on the orders of Chief Minister Jayalalithaa, is probing the murders of Ramesh and Hindu Munnani leader S Vellaiyappan.