The incident occurred in afternoon when the girl was playing outside the house of her neighbour Syed Ali, they said.
Ali allegedly lured the child inside his house under the pretext of offering her chocolate and then tried to rape her, said Myalavarm Circle Inspector D.V. Ramana.
However, the girl was saved after Ali's neighbours raised an alarm and called her parents who rushed to Ali's house.
Police arrested Ali and booked him under appropriate sections of IPC.