India has just adopted tough new rules guaranteeing an open and fair internet for nearly half a billion people.

The government has taken an "unambiguous stand" on the issue by endorsing net neutrality rules proposed last November, India's telecom regulator said on Thursday.

Net neutrality rules require internet providers to treat all online content the same, preventing them from favoring — or withholding — access to certain websites, services or apps.

The principle is under attack in America, where the Trump administration repealed federal laws last month, but has been staunchly defended in India in the face of attempts by global tech companies such as Facebook (FB) to offer stripped-down internet access.

Over 800 million Indians — or two thirds of the country's population — still don't have access to the internet, but that is changing fast thanks to a smartphone boom and cheaper mobile data. It's a huge potential market that companies are racing to tap, and Indian activists believe net neutrality is vital to ensure that hundreds of millions of Indians aren't exploited in the process.

The government seems to agree.

"Internet access services should be governed by a principle that restricts any form of discrimination or interference in the treatment of content," the new Indian regulations state. That includes "practices like blocking, degrading, slowing down or granting preferential speeds or treatment to any content."

Internet service providers who break the rules could lose their licenses to operate in India.

With Telecom Commission's endorsement of TRAI's recommendations on #NetNeutrality, India takes an unambiguous stand on this issue.

- thread - — TRAI (@TRAI) July 12, 2018

The rules grant exceptions to some services, including internet calling and online television provided by telecom companies. It also allows these providers to ignore net neutrality in case of emergencies, security threats or to manage high traffic across the network.

'Strongest' rules in the world

But proponents of net neutrality hailed the Indian government's decision as a major step, particularly given the Federal Communications Commission (FCC) decision to roll back similar protections in the United States.

"This is a very strong deterrent that has been created for net neutrality violations," said Nikhil Pahwa, co-founder of India's Save the Internet campaign. "Unlike the US, where the FCC has gone back and is essentially opposing net neutrality, India has now the strongest net neutrality regulations in the world," he added.

Related: What the US net neutrality repeal means

Pahwa was at the forefront of India's first battle to preserve net neutrality in 2015, when Facebook's plan to provide free internet to hundreds of millions of Indians came under immense public pressure. The government ultimately blocked the "Free Basics" program in early 2016, on the grounds that it violated net neutrality.

Facebook wanted to offer a free, lighter version of the internet to people without broadband or data connections, featuring select apps including Accuweather, Wikipedia and, of course, Facebook.

The new regulations affirm the Indian government's commitment to a free and fair internet, Pahwa added.

"It is way better than what we were up against when we started, when we thought India would have no net neutrality at all," he said.