Image copyright AFP Image caption Canada's Prime Minister Justin Trudeau (R) and Cuban President Raul Castro (L) during a recent visit to Cuba

Canadian Prime Minister Justin Trudeau must have been feeling the heat.

Mr Trudeau will not attend Fidel Castro's funeral in Cuba this week, despite the decades-long friendship between his father and the former Cuban communist leader.

Canada will be represented by Governor General David Johnston at a memorial service in Havana on Tuesday.

Mr Trudeau's decision comes after his initial statement on Castro's death was mocked worldwide.

Over the weekend, the hashtag #trudeaueulogies trended after the prime minister's office released a statement referring to "Cuba's longest serving President" as a "remarkable leader" for whom the Cuban people had "a deep and lasting affection".

Image copyright AFP Image caption Castro attended Pierre Elliott Trudeau's funeral in 2000.

It opened the floodgates on Twitter, as users gleefully satirised Mr Trudeau with fictitious tributes to historical and fictional dictators and despots, from Mussolini to Darth Vader.

Cuban-American senators Ted Cruz and Marco Rubio were also harshly critical of the prime minister's comments.

On Monday, his Canadian political opponents called Mr Trudeau "naive" for ignoring human rights abuses in the Caribbean nation.

Human Rights Watch has documented a "dark legacy" under Castro that included the punishment of dissent and the incarceration of political opponents.

Mr Trudeau tersely conceded to journalists on Sunday that Castro was a dictator and that "there certainly were significant concerns around human rights".

Image copyright AFP Image caption Fidel Castro died last week at 90

He added: "The fact is Fidel Castro had a deep and lasting impact on the Cuban people".

Castro's critics have been pressuring Mr Trudeau and other world leaders to snub the controversial former leader's funeral.

US President Barack Obama and UK Prime Minister Theresa May are not attending. The prime minister's office says Mr Trudeau's schedule is preventing him from making an appearance.

Cuban-Canadian musician Luis Mario Ochoa, who fled Cuba in 1990, said Mr Trudeau had made the right decision to forgo the event.

The musician said it made no sense that Canada would recognise the "pain" and oppression he experienced under the Castro regime by granting him asylum, while having Mr Trudeau pay tribute to Castro in official statements.

But with Mr Trudeau's decision to skip the funeral, Mr Ochoa said he's "willing to forget and forgive" the earlier remarks.

Canada and Cuba have long-lasting diplomatic ties.

Canada also hosted the secret talks that eventually led to the 2014 breakthrough in Cuba-US relations. About a million Canadians visit Cuba each year, the country's largest source of tourists.

Image copyright AFP Image caption Former Canadian prime minister Pierre Elliott Trudeau visited Cuba in 1976, sparking a friendship with Castro

The Trudeaus and the Castros also have a relationship that goes back decades.

Former Canadian Prime Minister Pierre Elliott Trudeau was the first leader of a Nato country to visit the Caribbean nation after the United States implemented an economic embargo amid rising Cold War tensions.

The two men developed a longstanding friendship following that 1976 visit.

Historian Robert Wright, who wrote a definitive account of the trip, said the two men clicked over their shared "cerebral and intellectual natures".

But he said the "liberal individualist" Trudeau and "communist revolutionary" Castro never found much ideological common ground.

Castro was an honorary pallbearer at the elder Trudeau's funeral in Montreal in 2000.

The prime minister is not the first of the elder Trudeau's children to praise Castro.

In 2006, Alexander Trudeau caused a stir for an op-ed in which he called him "something of a superman".

The Governor General, Queen Elizabeth II's representative in Canada, will attend a service in Havana on Tuesday, part of nine days of mourning in the country before Castro's ashes are laid to rest on Sunday.