Nimoy later described that 2007 encounter, at a luncheon where John McCain, Hillary Clinton and Obama were all present as presidential candidates.
"This candidate came through the crowd, and saw me and said, 'I heard you were here' -- and did this," Nimoy said, flashing the V-shaped Vulcan salute. "It was Barack Obama."
In 2012, Obama flashed that salute again, for an Oval Office photo with actress Nichelle Nichols, who had a groundbreaking role on "Star Trek" as Lt. Uhura.
"Live Long & Prosper!" Nichols wrote when she shared the photo on her now-defunct Twitter account.
Obama and Nimoy intersected in other ways, too.
Here, for instance, is CNN's Jake Tapper exchanging self-deprecating Spock references with Obama at a 2009 news conference -- Tapper on his own language, Obama on his ears.
And several years ago, the Times noted, "Obama told ABC's Barbara Walters that his critics wrongly believed he was 'Spock-like,' or too analytical.'"