Elon Musk's social media platform X said Thursday it will block certain accounts and posts from India in response to executive orders by the government.

X said it did not agree with the order but failure to comply would subject the company to "potential penalties including significant fines and imprisonment."

"We will withhold these accounts and posts in India alone; however, we disagree with these actions and maintain that freedom of expression should extend to these posts," the Global Government Affairs of the platform said without naming those accounts.

The announcement did not state a reason, but several linked the government's executive order to the .

CNBC has reached out to the country's Ministry of Information and Broadcasting for further comments.

Tens of thousands of Indian farmers — mostly from the northern state of Punjab — have been protesting since mid-February in renewed calls for better crop prices which were promised to them in 2021.

They have been marching toward the capital of New Delhi for over a week now, but protests halted on Wednesday after a young protester and others injured in clashes with the police who fired tear gas and used water cannons to disperse thousands heading toward Delhi,

India's government and X have been at loggerheads for years.

In June, Jack Dorsey — co-founder of Twitter, which was rebranded to X under Musk — claimed the unless it complied with orders to block accounts that criticized how the government handled previous farmer protests.

Prime Minister Narendra Modi's government has refuted the allegations as a "lie."

In October, the Musk that X would have to comply to country's new and upcoming IT rules.

During the pandemic, X was ordered to remove posts criticizing the government of the way it

India's freedom of expression was ranked at 0.52 in 2022, lower than Pakistan (0.66) and Sri Lanka (0.67), according to

X said in a post that it was unable to publish the executive orders "due to legal restrictions." However, it has written an appeal challenging the Indian government with accounts that are pending to be blocked, the company said.

"We have also provided the impacted users with notice of these actions in accordance with our policies," it said in a post.

"We believe that making them public is essential for transparency," the post added. "This lack of disclosure can lead to a lack of accountability and arbitrary decision-making."

Indian residents took to the social media platform to express their frustration with the decision, posting angry sentiments like and

— CNBC's Naman Tandon contributed to this story.