Canadian Prime Minister Justin Trudeau is facing criticism after pledging millions to a charity Sunday in a tweet to comedian Trevor Noah.

Trudeau in a tweet lamented the fact that he couldn’t attend the Global Citizen Festival: Mandela 100 in Johannesburg where celebrities were gathering to honor Nelson Mandela’s legacy. He said Canada would instead pledge $50 million to Education Cannot Wait – an organization which helps educate children and youth in countries in crises.

“Hey @Trevornoah - thanks for everything you're doing to celebrate Nelson Mandela's legacy at the @GlblCtzn festival. Sorry I can't be with you - but how about Canada pledges $50M to @EduCannotWait to support education for women & girls around the world? Work for you? Let's do it,” Trudeau tweeted to the “The Daily Show” host.

Noah showed Trudeau’s tweet at the event, according to CBC.

However, Trudeau faced harsh backlash from his pledge.

Andrew Scheer, Canada’s conservative leader, accused Trudeau of making the donation to impress a celebrity.

“Taxpayers need a defender not somebody who throws their money around to be popular with celebrities,” he said in a tweet.

Conservative MP Michelle Rempel echoed Scheer, saying Trudeau’s pledge was “tone deaf” and also accused him of trying to gain popularity with a celelbrity.

Louis Belanger, the director of communications for Canadian International Development Minister Marie-Claude Bibeau, clarified that the $50 million was a part of a $400 million pledge in aid made during the G7 summit in June, according to CBC. Belanger said the decision to announce it was made three weeks ago.

Gerald Butts, Trudeau’s principal secretary, also defende the move.

“This money is going to educate women and girls in the developing world, in commemoration of Nelson Mandela's 100th birthday,” Butts said in a tweet.