At the end of the new video, two sentences on screen urged fans to sign a petition urging the U.S Senate to pass legislation that would protect LGBTQ people from discrimination

LOS ANGELES, June 17 (Reuters) - Pop singer and songwriter Taylor Swift on Monday released a star-studded music video that scolded social media trolls and urged fans to sign a petition demanding U.S. legal protections for gays, lesbians and transgender people.

The video for Swift's new single "You Need to Calm Down" featured a surprise cameo by former rival Katy Perry plus a host of other celebrities. Perry's appearance signaled an end to a spat between the two musicians which began in 2013 over backup singers in their shows.

Set in a pastel-colored trailer park, the video featured Swift, 29, relaxing in a pool while she called out her critics and those who attack LGBTQ people. "Shade never made anybody less gay," she sang.

Celebrities in the video who identify as LGBTQ include Ellen DeGeneres, Billy Porter, RuPaul, Jesse Tyler Ferguson, Adam Lambert, Hannah Hart and Tan France.

Swift, all smiles and outfitted as French fries, hugged Perry, 34, dressed as a hamburger, a costume she wore to last month's Met Gala fundraiser at the Metropolitan Museum of Art.

Social media posts in 2018 suggested an end to their spat, which had played out in their songs. On Tuesday, Perry posted a photo on her Instagram account, with Swift being tagged, showing a plate of cookies with the words "Peace at last" appearing to be written in icing.

At the end of the new video, two sentences on screen urged fans to sign a petition urging the U.S Senate to pass legislation that would protect LGBTQ people from discrimination. The measure has already cleared the U.S. House of Representatives.

"Let's show our pride by demanding that, on a national level, our laws truly treat all of our citizens equally," it said.

The petition had collected more than 222,000 signatures within a few hours.

Swift, who has more than 118 million Instagram followers, has been stepped into politics in 2018 by supporting two Democrats running in U.S. congressional elections in Tennessee. Voter registrations spiked in the state, but Swift's preferred candidate for Senate lost the election. (Reporting by Lisa Richwine; Editing by Richard Chang)

Openly is an initiative of the Thomson Reuters Foundation dedicated to impartial coverage of LGBT+ issues from around the world.

Our Standards: The Thomson Reuters Trust Principles.