Texas senator and Republican presidential candidate Ted Cruz made a joke at the expense of vice president Joe Biden on Wednesday night during a dinner hosted by a group of Republicans in Michigan. Cruz was quickly reprimanded for the timing of his quip, as Biden will bury his son in a funeral on Saturday. Beau Biden passed away over the weekend from brain cancer. Reuters/Eduardo Munoz

Sen. Ted Cruz apparently thought he was being witty when he cracked a joke about Vice President Joe Biden while speaking to a group of Republicans in Michigan on Wednesday night. But jokes depend on successful timing, and Cruz made his comment on the eve of a memorial for the vice president’s son, Beau Biden, who died on Saturday at the age of 46 after battling brain cancer. Cruz, who was the first Republican to announce his candidacy for president in the 2016 election -- and who already has a "likability" problem -- was quickly reprimanded on Twitter for the quip.

Cruz made the joke while speaking at a dinner hosted by the Livingston County Republicans in Howell, Michigan. Chad Livengood, a reporter for the Detroit News, broke the story of the joke on Twitter:

Livengood reported the rest of the joke in a story for the News: “Honestly, it works,” Cruz continued. “The next party you’re at, just walk up to someone and say, ‘Vice President Joe Biden’ and just close your mouth. They will crack up laughing.”

When Livengood confronted Cruz about the joke, he had little more to say.

Cruz has made the exact same joke in the past, Business Insider reports, but this time Cruz was criticized on Twitter for making a bereaved father the butt of a joke.

Cruz apologized for the jab in a Facebook post shortly after his speech, saying: "It was a mistake to use an old joke about Joe Biden during his time of grief, and I sincerely apologize. The loss of his son is heartbreaking and tragic, and our prayers are very much with the Vice President and his family."