"Aliens built the pyramids obv," Musk had tweeted, picking up on a theme popular with conspiracy theorists and kicking off a predictable flood of replies ranging from light-hearted to furious.
Among the avalanche of one-liners, memes and potshots were some angry messages from nationalistic Egyptians who demanded the eccentric engineer and high-tech billionaire better check his facts.
Egyptian International Cooperation Minister Rania Al Mashat, a savvy social media user, however, saw a marketing opportunity to help revive the country's pandemic-battered tourism sector.
"I follow your work with a lot of admiration," wrote Mashat, a former tourism minister. "I invite you & Space X to explore the writings about how the pyramids were built and also to check out the tombs of the pyramid builders.
"Mr Musk, we are waiting for you," she added, inviting the entrepreneur to come and see for himself one of the Seven Wonders of the Ancient World, Egypt's enormous tombs built for pharaohs and their consorts.
Musk followed up by posting a link to a BBC article about the history of the giant structures, calling it "a sensible summary" of how they were constructed.
The most famous and largest of Egypt's ancient monuments, the Giza Pyramids outside Cairo, reopened to the public last month after a three-month closure forced by the coronavirus pandemic.
Egypt's tourism sector suffered a decade of turmoil after the 2011 Arab Spring protests and overthrow of Hosni Mubarak, with militant attacks and political instability keeping many tourists away.
The tourism sector, which accounts for a fifth of the country's GDP and employs some 3 million people, had recovered to draw record visitors, around 13.6 million last year, when the COVID-19 crisis struck