ANTANANARIVO, Madagascar — Justin Trudeau wanted to deliver a strong message on human rights during his first trip to Africa as prime minister, and while he certainly made a big splash on that issue, it was not for the reasons he had originally intended.

As the prime minister called out world leaders, including many in French-speaking Africa, to get better at protecting the rights of women and girls and the LGBTQ community, he came under harsh criticism at home for issuing a statement praising the legacy of former Cuban president Fidel Castro.

“He certainly was a polarizing figure and there certainly were significant concerns around human rights,” Trudeau said Sunday in Antananarivo, Madagascar, where he was leading the Canadian delegation to the summit of la Francophonie.

“That’s something that I’m open about and highlighted, but on the passing of his death I expressed a statement that highlighted the deep connection between the people of Canada and the people of Cuba,” Trudeau said at a news conference.

When asked directly whether he thought Castro was a dictator, Trudeau said: “Yes.”

The Liberal prime minister is facing criticism at home and abroad for a statement he issued shortly after learning that Castro had died at the age of 90.

The statement expressed his “deep sorrow” about the death of Castro, without mentioning the human rights violations of his regime beyond referring vaguely to him as a “a controversial figure.” Trudeau also referred to him as a “legendary revolutionary and orator,” who made significant improvements to the education and health-care systems of Cuba.

“I know my father was very proud to call him a friend,” Trudeau also said in his statement.

His father, former prime minister Pierre Trudeau, was the first NATO leader to visit Cuba when he met the leader of Cuba’s communist revolution — and long-time antagonist of the United States — in 1976, and Castro came to Montreal to attend his funeral nearly a quarter-century later.

Asked whether he regretted the wording of the statement, Trudeau seemed to draw a comparison to how people reacted to the death of Castro to how they reacted to the death of his father, although he did not mention him by name.

“I have a personal recollection of the reaction when a long-time political figure of a particular country passes away, however polarizing they may have been for certain people,” he said.

Quebec Premier Philippe Couillard did not think the message from Trudeau was inappropriate given Castro had just passed away.

“Yes, his accomplishments will be in various tones of grey — some white, some black — but historians will have to decide this,” Couillard, who headed the Quebec delegation to la Francophonie, told reporters Sunday.

“I see no controversy in describing him as a giant of the 20th century,” he said.

Trudeau delivered a shorter version of his condolence message Saturday at the beginning of his keynote address at the opening ceremonies of la Francophonie — a speech, ironically, that called out other world leaders for human rights abuses against girls, women and the LGBTQ community.

Trudeau said he never shies away from raising human rights issues, including on his recent visit to Cuba.

“Canadians know that I always talk about human rights, including here yesterday, including with Raul Castro two weeks ago and wherever I go around the world,” he said.

That was true in Antananarivo, where Trudeau said he was encouraged by the conversations he had following his speech that said LGBTQ people deserve the “same respect, the same rights and the same dignity” as everyone else — even as many in the audience were representing countries where homosexual activity is still illegal.

“I was actually extremely encouraged by the conversations I had throughout the day yesterday and into today, by people talking about where their communities were, where their societies are and accepting the critique and the challenge that if we’re going to respect human rights, we need to respect everyone’s human rights and that includes the LGBTQ community,” Trudeau said at the news conference.

The federal government also announced $112.8 million for international assistance projects aimed at several countries in Africa, as well as Haiti.

The Antananarivo Declaration — arrived at by consensus among the group of 80 mainly French-speaking members and observers — included language on human rights, particularly those of women and girls, and adopted the resolution Canada put forward condemning child, early and forced marriages.

It did not mention the LGBTQ community in particular, but Quebec Premier Philippe Couillard said there will be an event next year to discuss the rights and situation of the LGBTQ community in the French-speaking world, even though it is not being organized through la Francophonie itself.