He tweeted Sadiq Khan, the first Muslim to take the helm of a European Union capital, with one of his character Captain Kirk's most famous and appropriate lines.
"Khaaaaaaaaaannnnnnnnnn!!! Congratulations Mr. Mayor! Bill," Shatner wrote on Sunday.
He was referring to the 1982 movie "Star Trek II: The Wrath of Khan," in which the genetically enhanced villain Khan Noonien Singh tries to exact revenge on Kirk.
One celebrated scene shows Shatner screaming out an extended version of the baddie's name. Watch it here:
The new mayor, a member of the center-left Labour Party who replaces outgoing Conservative Mayor Boris Johnson, has yet to publicly reply to Shatner.
But he did follow the actor back on Twitter, prompting the 85-year-old to put himself on "red alert."
Good effort, captain!