Rapper Lil Wayne has thanked Donald Trump for pardoning him during his final hours as president.

Wayne, whose real name is Dwayne Michael Carter, admitted a weapons charge in December and was due to be sentenced later this month.

The hip-hop star, a convicted felon, was facing up to 10 years in jail before Trump intervened.

Wayne thanked the former president for granting him a pardon.

He tweeted: "I want to thank President Trump for recognising that I have so much more to give to my family, my art, and my community."

Trump also commuted the sentence of rapper Kodak Black, who like Wayne was convicted of a weapons charge in Florida.

He was serving a 46-month sentence before being freed this week.

Black said: "I Want To Thank The President @RealDonaldTrump For His Commitment To Justice Reform And Shortening My Sentence. I Also Want To Thank Everyone For Their Support And Love.

"It Means More Than You Will Ever Know. I Want To Continue Giving Back, Learning And Growing."

Before leaving office, Trump also granted clemency to his former advisor Steve Bannon and major Republican Party fundraiser Elliott Broidy.