The head of the Boy Scouts of America has apologised to the organization for the “political rhetoric that was inserted” into its national gathering this week by Donald Trump.

“I want to extend my sincere apologies to those in our Scouting family who were offended by the political rhetoric that was inserted into the jamboree,” Michael Surbaugh wrote in an open letter published on the Scouts’ website. “That was never our intent.”

He said that every US president – each serves as the Scouts’ honorary president – has been invited to speak at the national jamborees held every four years since 1937, but that the Scouts were nonetheless “steadfastly” non-partisan.

“We sincerely regret that politics were inserted into the Scouting program,” Surbaugh wrote.

He said there were 40,000 participants, including Boy Scouts, volunteers, staff and visitors.

Trump, a Republican, started his speech before thousands of boys aged 12 to 18 in a West Virginia field on Monday evening lauding hard work and perseverance, then quickly turned to partisan attacks and ridicule of “fake media”.

He attacked Democratic rivals, lambasted the current healthcare law and reminisced about a cocktail party he went to decades ago filled with “the hottest people in New York”.