(Nichelle Nichols)
President Obama and actress Nichelle Nichols, in 2012. (Nichelle Nichols)

President Obama released a statement on Friday marking the death of actor Leonard Nimoy, best known for portraying Spock on "Star Trek."

"Long before being nerdy was cool," Obama said, "there was Leonard Nimoy."

The full statement goes on:

Leonard was a lifelong lover of the arts and humanities, a supporter of the sciences, generous with his talent and his time. And of course, Leonard was Spock. Cool, logical, big-eared and level-headed, the center of Star Trek’s optimistic, inclusive vision of humanity’s future.

I loved Spock.

In 2007, I had the chance to meet Leonard in person. It was only logical to greet him with the Vulcan salute, the universal sign for “Live long and prosper.” And after 83 years on this planet – and on his visits to many others – it’s clear Leonard Nimoy did just that. Michelle and I join his family, friends, and countless fans who miss him so dearly today.

The two men had history.

Leonard Nimoy. (Matt Sayles/AP file)

According to the Los Angeles Times, at a 2007 event in Los Angeles, then-senator Obama "spied Nimoy across a room, smiled, and held up his hand in the familiar gesture."

[Leonard Nimoy’s final public words: ‘Live long and prosper’]

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.

[George Takei, William Shatner mourn the death of ‘Star Trek’ star Leonard Nimoy]

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.'"

MORE READINGThe Jewish roots of Leonard Nimoy and ‘live long and prosper’

Obituary: Leonard Nimoy, a pop culture force as Spock of ‘Star Trek,’ dies at 83

Leonard Nimoy’s struggle with being Spock

Reactions pour in following Leonard Nimoy's death