David Mcnew / AFP/Getty Images

Elon Musk's use of Twitter has been under fire in recent months, but one school district took to the social network to thank the Tesla and SpaceX CEO.

In a tweet on Thursday, Michigan's Flint School District thanked Musk and his nonprofit foundation for donating money for the purchase of water filtration systems.

"Your generous donation will help us replace ALL water fountains w/NEW WATER STATIONS & WATER FILTRATION at ALL SCHOOLS! Looking forward to our burgeoning partnership! More to come!" reads the tweet.

Thank you @elonmusk and @MuskFoundation for investing in the health/future well-being FCS Students! Your generous donation will help us replace ALL water fountains w/NEW WATER STATIONS & WATER FILTRATION at ALL SCHOOLS! Looking forward to our burgeoning partnership! More to come! — Flint Schools (@FlintSchools) October 4, 2018

This comes after Musk said on Twitter in July that he would personally pay to fix the notorious water in Flint, Michigan, for any house that has water contamination above FDA levels. He said he would organize a weekend in Flint to add filters to houses.

So far, Musk has agreed to donate $480,350 to purchase and install ultraviolet filtration systems in all 12 Flint school buildings and the district's administration building by January 2019, according to Michigan Live.

"The new water filtration systems will be instrumental in helping our students return to the normalcy of what should be a fundamental right: having access to safe, clean water from water fountains in their school," Flint Community Schools Superintendent Derrick Lopez told MLive.

Flint's tap water became contaminated with lead in 2014 after officials switched from the Detroit system to the Flint River to save money, according to CBS News. The city reportedly didn't implement proper procedures to prevent corrosive water from breaking down aging lead pipes, exposing many residents to the neurotoxin in their drinking water.

Musk has been surrounded with controversy lately, some of it stemming from his comments on Twitter. Last month, Musk reached a settlement with the US Securities and Exchange Commission after an August tweet in which he said he was considering taking Tesla private. In a tweet last week however, Musk mocked the SEC, dubbing the regulatory agency the "Shortseller Enrichment Commission." Musk is also being sued by a British diver Vernon Unsworth, who helped rescue several boys from a flooded Thai cave in July, after Musk repeatedly called him a "pedo guy" on Twitter.

Musk's representative didn't respond to requests for comment.

First published on Oct. 8, 12:02 p.m. PT.

Update, Oct. 12, 6:02 a.m. PT: Adds more background on Flint's water contamination.

NASA turns 60: The space agency has taken humanity farther than anyone else, and it has plans to go further.

Taking It to Extremes: Mix insane situations -- erupting volcanoes, nuclear meltdowns, 30-foot waves -- with everyday tech. Here's what happens.