The Thrissur chief judicial magistrate granted him bail on the basis of two sureties.
A huge crowd had gathered after news spread that the superstar was to appear in court.
The war of words between the two broke out when Azhikode came in support of thespian actor Thilakan who was served a show cause notice by the Association of Malayalam Movie Artists (AMMA) and subsequently sacked him on grounds of indiscipline.
Azhikode attacked Mohanlal, who was an office bearer of AMMA, saying that the actor has become old and should limit himself to roles matching his age and figure. He also criticised the actor endorsing a jewellery brand.
The actor retorted, saying Azhikode must be having some "hallucination" and that he considered Azhikode's statements as some "aged uncle's joke".
The superstar allegedly said the writer may be mentally deranged to make such statements, following which Azhikode filed a defamation suit.