Three persons were killed in firing as violence erupted during the court-ordered survey of a mosque in Sambhal district in Uttar Pradesh on Sunday.