William Shatner has defended his absence from longtime friend and “Star Trek” colleague Leonard Nimoy’s funeral — turning to Twitter to explain he had a longtime commitment to a charity event, and was unable to make it back to Los Angeles in time for the funeral.

The actor realized he needed to explain the absence after a big social media outcry and the New York Daily News headline calling him “Captain Jerk,” a sarcastic twist on his “Star Trek” character Captain Kirk, for not making it to the Nimoy memorial.

Shatner tweeted, “I chose to honor a commitment I made months ago to appear at a charitable fundraiser. A lot of money was raised. So here I am; tell me off.”

The event Shatner was talking about was a big charity benefit for the American Red Cross.

While the actor said it was impossible to find a commercial flight from Florida (where the benefit took place) to L.A. in time to make the funeral, a radio deejay suggested Shatner charter a private jet to get to Los Angeles in time. That led Shatner to reply, “I must have missed your email about underwriting the arrangement and payment for this.”

Shatner’s two daughters represented him at the Nimoy funeral.

Moving on from the online flak, Shatner began using the #LeonardNimoy hashtag to eulogize his friend. Shatner wrote, “Leonard and I seemed to be bound by fate to be friends. We were born 4 days apart. He was tall, lanky and sometimes a bit too serious. We worked together previous to Star Trek, first impressions: nice guy, a real professional, took the job/role seriously.”

Shatner posted other comments, noting that when not working, Nimoy was “intelligent, insightful, just a precious gem of a man.”