Students and teachers at Doyle-Rider Elementary in Flint got a surprise Friday — a visit from Tesla and SpaceX CEO Elon Musk.

According to WSMH-TV, Musk took part in an assembly for a group of sixth- and seventh-graders from seven elementary schools in the district. He shared anecdotes about his childhood and company projects, including his rocket failures for SpaceX.

Near the end of his presentation, Musk, along with Flint School Superintendent Derrick Lopez, announced that every student present at the assembly would receive a laptop. Musk will also be flying out two students from each elementary school to the SpaceX factory in California.

The entrepreneur's visit is the latest in Musk's commitment to helping the citizens of Flint.

In December, Musk donated $423,000 to pay for Chromebook laptops for all seventh- and eighth-graders in the Flint Community Schools District.

Then, in October, Musk announced he would pay for new water stations and water filtration for the school district.

More:Elon Musk: Tesla 'would be interested' in GM's idled factories

More:Elon Musk gives over $400K to buy laptops for Flint students