Rahul Gandhi, a leader of India's main opposition Congress party, addresses the crowd at a public rally during the Bharat Jodo Yatra (Unite India March), in Panipat, India, January 6, 2023.

A court in western India found opposition leader Rahul Gandhi guilty of defamation on Thursday for a speech he made in 2019 in which he referred to thieves as having the surname Modi, and sentenced him two years in prison.

Gandhi was present at the court in Surat, a city in Gujarat, which is Prime Minister Narendra Modi’s home state. He was given bail and the sentence was suspended for 30 days.

The criminal defamation case was filed against Gandhi by a leader of the ruling Bharatiya Janata Party (BJP), after a speech during the 2019 general election in which he referred to the surname Modi and asked how all thieves had the surname.

“The court has found Rahul Gandhi’s comment to be defamatory. The court found him guilty under IPC section 499 read with 500. He has been sentenced to two years in jail,” Ketan Reshamwala, advocate for complainant Purnesh Modi, said.

Gandhi said in court that he had made the comment to highlight corruption and not against any community.

Gandhi is one of the main opposition leaders in the country who will go up against Modi when he seeks his third term as prime minister in 2024.

Gandhi’s once-dominant Congress controls less than 10% of the elected seats in parliament’s lower house and has lost badly to the BJP in two successive general elections, most recently in 2019.

Modi remains India’s most popular politician by a substantial margin and is widely expected to win a third victory at the next general election in 2024.