Sanjay Chowdhary, a resident of Dayalbagh, an Agra suburb, was arrested late on Monday; his laptop, a sim card and a data card have been impounded.
The police said Mr Chowdhary, a civil engineer, was arrested on "specific information" about certain "communal and inflammatory" posts by him. A senior policeman, Subhash Chandra Dubey, said their concern was only law and order. "We are not involved in the political angle of the whole issue, our concern was the inflammatory comments and posts on the Facebook wall of this man and we acted to prevent any communal flare-up," he told IANS.
But some officials did admit that the matter was being treated as "hypersensitive" because of the comments Mr Chowdhury made about Mr Yadav, whose party, the SP, rules Uttar Pradesh.
The posts on Mr Chowdhury's Facebook page were deleted soon after his arrest and his account was later deactivated.
Mr Chowdhury, who is also the chairman of a public school, has been booked under section 153 A of the Indian Penal Code (IPC) which deals with "promoting enmity between groups" and "acts prejudicial to maintenance of harmony", and the controversial Section 66 A of the Information Technology (IT) Act which penalizes cyber crime.
The arrest of people for what they write on Facebook or other social networking sites, particularly about political leaders, has been slammed by many as an attempt to muzzle freedom of speech and expression. Last year, the arrest of two young woman in a Mumbai suburb for a comment on Shiv Sena founder Bal Thackeray, became a huge controversy with the Maharashtra Police facing much criticism for its hasty decision to act against them.
A sessions court in Palghar, Maharashtra, dropped the cases against the girls after the police filed a closure report