Amid clashes between party workers and the police, Bharatiya Janata Party (BJP) candidate Varun Gandhi was on Saturday sent to jail in Pilibhit until March 30 for his reportedly hate speeches.
Pilibhit's chief judicial magistrate sent Varun Gandhi to judicial custody until the next hearing on Monday after he surrendered, BJP leader Kalraj Misra said.
The court sentence came shortly after Gandhi said that he was "ready to go to jail" over the anti-Muslim speeches he denies making but which have ignited a huge controversy.
Hundreds of supporters followed the police vehicle in which Gandhi was taken away from the court. Many of them were seen clinging to the vehicle and climbing onto its bonnet, making it difficult for the policemen to drive.
Police then opened fire on the mob that turned violent sooner after the motorcade carrying Gandhi reached the local prison gates. Three people were injured in the firing.
Before leaving the court, Varun said: "I respect the judiciary and have full faith in it. If my going to jail generates confidence and power in the people of my society to fight for their principles, I am ready for it".
"I am a victim of a political conspiracy," he said.
Earlier, Gandhi reached the court complex with a large number of supporters who were shouting slogans hailing him and waving BJP flags.
Initially, the judge told his lawyers that there was no warrant against Gandhi and if he wanted to surrender he should file an affidavit mentioning the sections under which cases have been registered against him.
Clad in a maroon kurta, Gandhi told reporters here in Pilibhit, around 350 km from Lucknow: "I will do whatever possible to instil confidence in my people, my community and my country. I will not step back. I am prepared to go to jail to stand by my principles."
Around 50 BJP workers were arrested here on Saturday after they blocked roads and clashed with the police while waiting for Gandhi. They were charged with unlawful assembly.
Security forces were deployed at the Pilibhit border, officials said.
Gandhi courted controversy after he allegedly made communally venomous speeches while seeking votes. Once the speeches surfaced on CDs, he alleged they were doctored.
The Election Commission came down heavily on him and suggested that he should not be fielded as a candidate in the Lok Sabha election. The BJP refused to do that.
On Friday, Gandhi withdrew his bail application from the Delhi High Court and decided to court arrest.
The Election Commission wants criminal charges to be filed against him for his speeches.
In New Delhi, Congress spokesman Kapil Sibal described Gandhi's surrender and arrest as a "drama".
"A drama is being enacted by Varun Gandhi. I am sure that (BJP leader LK) Advaniji is in tune with it. Without his consent, it would not have happened," Sibal said.