Karan Deep Singh and Hari Kumar

NEW DELHI — First, the firebrand lawyer wrote a one-sentence tweet opining about the Indian Supreme Court’s role in eroding freedoms in the world’s largest democracy. Two days later, he tweeted a photo of the court’s chief justice astride a Harley-Davidson owned by a political ally of the country’s powerful prime minister.

On Monday, the man behind the tweets, Prashant Bhushan, one of India’s most prominent public interest lawyers, will face a choice: apologize for the tweets, which the court found insulting, or go to prison.

The possibility that Mr. Bhushan, one of India’s most celebrated lawyers, could be sent to jail for a pair of social media posts has sent shock waves through India’s legal community, with activists calling the case a setback for India’s democracy and the independence of its once vaunted judiciary.

Mr. Bhushan, 63, said that he will face sentencing on Tuesday for the tweets, which the Supreme Court this month ruled were criminally contemptuous.

“I feel that democracy has been destroyed in the last six years,” Mr. Bhushan said in an interview about the time Prime Minister Narendra Modi, a nationalist and populist, has been in office.

In an earlier statement, Mr. Bhushan indicated he would rather serve the maximum six-month sentence than apologize. “It would be insincere and contemptuous on my part to offer an apology for the tweets that expressed what was and continues to be my bona fide belief,” he said.

Mr. Bhushan’s case has effectively put the court on trial. Many lawyers say the Supreme Court has been steadily losing its independence and too often reflexively sides with the government.

Some attorneys hit the streets to protest Mr. Bhushan’s conviction, and many others, along with human rights activists, opposition politicians and journalists, have urged the court not to send him to jail.

“It is shocking,” said Lalit Bhasin, the president of the Bar Association of India, an umbrella organization that represents thousands of lawyers. “You are scuttling the voice of the entire legal profession.”

Mr. Bhushan made a career of taking on the government, well before Mr. Modi and his Hindu nationalist Bharatiya Janata Party came to power in 2014. Mr. Bhushan filed several corruption cases under previous governments, including those led by Mr. Modi’s opposition, the Indian National Congress.

But in recent years, he has become one of the Modi administration’s harshest critics. Mr. Bhushan has filed public interest suits accusing Mr. Modi’s government of wrongdoing, and has frequently spoken out about a Supreme Court, which in his estimation, too often sides with the government.

The two comments that put Mr. Bhushan in the defendant’s seat were written in June and posted on Twitter, where the lawyer has more than a million followers.

In one tweet, he accused Chief Justice Sharad Arvind Bobde of hypocrisy, by posting a photograph of the judge posing on a $67,000 Harley-Davidson motorcycle without a face mask and surrounded by people. Chief Justice Bobde, Mr. Bhushan said, was flouting health rules even though he had placed the court on lockdown “denying citizens their fundamental right to access justice.”

The court said in its response that even though physical hearings remain suspended, it conducted 879 hearings in nearly four months.

The motorcycle belonged to the son of a local leader from Mr. Modi’s party in the city of Nagpur.

In the other tweet, Mr. Bhushan wrote that the court played a role in “how democracy has been destroyed in India” during Mr. Modi’s terms in office.

The Supreme Court was not amused, and ruled earlier this month that the comments were a “calculated attack on the very foundation of the institution of the judiciary.”

Though the two tweets amounted to just 478 characters, the court issued a 108-page judgment that found Mr. Bhushan in contempt of court.

In July, Twitter removed both of Mr. Bhushan’s tweets from view in India, but activists took screenshots of the posts and circulated them widely.

Lawyers and digital rights advocates said Twitter set a dangerous legal standard, which could apply to similar future accusations of defamation.

In a statement, Twitter said the company was committed to protecting free expression in India and around the world.

India’s Supreme Court has long been seen as a pillar in the country’s often unruly democracy. It has recently made news for a series of progressive rulings: striking down a ban on consensual gay sex and repealing a law that stood in the way of freely expressing one’s views on the internet.

But the court has also handed Mr. Modi a series of recent political victories. In November, the court ruled in favor of Hindus in a decades-old dispute over a holy site in Ayodhya contested by Muslims, handing Mr. Modi and his followers a victory in their quest to recast the secular democracy as a Hindu nation.

In a speech earlier this month, A.P. Shah, a former chief justice of the Delhi High Court, said that the Supreme Court appeared to have “abdicated its role as arbiter,” when it deferred the matter regarding lifting restrictions on the internet and movement in the contested Jammu and Kashmir region, to a government-run committee.

“India is moving toward a form of elected autocracy,” said Mr. Shah.

But not everyone in the legal community backs Mr. Bhushan.

The contempt of court case started about a month after Mr. Bhushan posted the tweets when the nationalist lawyer, Mahek Maheshwari, filed a complaint, in which he called the remarks “unfair” and “factually incorrect.”

Mr. Maheshwari said in an interview that “there should always be a line between freedom of expression and disrespect.”

Mr. Bhasin, the head of the Bar Association, said that most of the country’s lawyers want the court to withdraw the ruling against Mr. Bhushan.

“The sentence,” he said, “is irrelevant.”

This story first appeared in the ‘New York Times’ here