Image copyright Getty Images

Pharrell Williams has told US President Donald Trump to stop playing his music at political events.

The warning comes after the US leader attended a rally in Indiana on Saturday where the song Happy was played.

The event was held just hours after 11 people were killed in a mass shooting in Pittsburgh.

A letter issued through Pharrell's lawyer said there was nothing "happy" about the tragedy and "no permission was granted" to use the song.

Image copyright Getty Images Image caption Tributes have been left at a synagogue in Pittsburgh where the attack happened

The shooting took place at the Tree of Life Synagogue and is being called the worst anti-Semitic attack in US history.

The 11 victims were aged between 54 and 97 and included a husband and wife.

Pharrell issued a cease-and-desist letter through his lawyer urging the US leader to stop playing his music.

Speaking on behalf of the star, Howard King wrote: "There was nothing 'happy' about the tragedy inflicted upon our country on Saturday and no permission was granted for your use of this song for this purpose."

Image copyright Getty Images Image caption Happy was played at the annual Future Farmers of America Convention and Expo in Indiana

Mr King added that Pharrell had not and will not grant the president permission to use his music and the use of the song Happy is a copyright and trademark infringement.

Pharrell is not the first artist to warn Mr Trump against using their music.

Earlier this month, Prince's estate warned the president about playing the star's hit Purple Rain at his rallies.

Aerosmith's Steven Tyler also filed a cease-and-desist letter after the song Livin' On The Edge was played at an event.

Follow Newsbeat on Instagram, Facebook and Twitter.

Listen to Newsbeat live at 12:45 and 17:45 every weekday on BBC Radio 1 and 1Xtra - if you miss us you can listen back here.