While the United States is walking away from the historic Paris Climate Agreement, India is making a bold vow to start selling only electric cars by 2030.

India is one of the world's most polluted countries. Its energy department said in a blog post that it has set the "ambitious" target to stop selling gas-powered vehicles in an attempt to clean up its air.

As the country's economy has boomed, new industries and commuters have spewed pollutants in the air at staggering rates. Now, its 1.3 billion residents are suffering. One estimate says India's air contributes to 1.2 million deaths per year. Doctors have said breathing the air in New Dehli, the nation's capital, is like smoking 10 cigarettes a day.

India's energy minister, Piyush Goyal, said recently that the country will help facilitate the electric car effort by offering subsidies for a couple of years. "After that," he said, "the cost of electric vehicles will start paying for themselves."

The government's National Electric Mobility Mission Plan wants annual sales of electric and hybrid cars to hit 6 million to 7 million by 2020.

Related: How one Indian entrepreneur is making a killing

That's music to the ears of Elon Musk, CEO of electric car powerhouse Tesla (TSLA), who touted the decision on Twitter Thursday.

India commits to sell only electric cars by 2030. It is already the largest market for solar power. https://t.co/EGBNTPzmE5 — Elon Musk (@elonmusk) June 1, 2017

Tesla hasn't actually entered the Indian market yet, but Musk has frequently talked about his plans to open up shop there. He said earlier this year that it could happen by summer, but those plans appear to be delayed.

India is anxiously awaiting Tesla's arrival. Even the head of Mahindra, India's leading electric carmaker, told Musk he'll welcome the competition.

Time you got out here Elon. You don't want to leave that whole market to Mahindra do you?? The more the merrier--and greener..! https://t.co/IPoA9viDRN — anand mahindra (@anandmahindra) June 2, 2017

"The more the merrier -- and greener," Anand Mahindra wrote.

Plans to aggressively expand the number of electric cars on the road is just one of a number of ways India is trying to go greener. The government is also underway on major pushes to expand its solar energy capacity.

Indian Prime Minister Narendra Modi has also doubled down on his commitment to the Paris Climate Agreement after President Trump rebuked the pact on Thursday.

Paris Agreement reflects our duty towards protecting the Earth and our natural resources. For us, this is an article of faith: PM pic.twitter.com/8cnSqClBPf — PMO India (@PMOIndia) June 3, 2017

He was in France on Saturday meeting with French President Emanuel Macron, who also strongly condemned Trump's decision.

"Paris Agreement is a shared legacy of the world. It will benefit the future generations as well," Modi wrote on Twitter.