Image copyright AFP/Getty Image caption Walmart said the t-shirt violated its policy

US retailer Walmart has removed from sale a T-shirt with a message about lynching journalists, after complaints.

The T-shirt, which said "Rope. Tree. Journalist. Some assembly required", was available on the Walmart website.

The retailer said the T-shirt had been provided by a third party seller that allows people to post their own designs and "clearly violates our policy".

The design gained notoriety during the 2016 US election when it was photographed at a Trump campaign event.

Third party seller Teespring said it had also removed the design and would do more to spot offensive content, Associated Press reported.

The company said it had added the slogan to its automated scanning system and had had staff search the site to find any similar content.

The US Radio Television Digital News Association (RTDNA) wrote to Walmart on Wednesday asking it to remove the T-shirt. It said Walmart appeared to be the only major US retailer selling the design.

RTDNA director Dan Shelley said such slogans "inflame passions" and "at worst, openly encourage violence targeting journalists".

"We believe they are particularly inflammatory within the context of today's vitriolic political and ideological environment," he said.

The RTDNA said about 30 journalists had been physically assaulted in the US this year while doing their jobs.

In 2016 Teespring and another self-design company Zazzle both pulled the same design from their websites after the Reuters photo was widely shared, the Daily Beast reported.

In August, Teespring removed a "rainbow swastika" design from its site, the Washington Post reported.