The head of the Boy Scouts of America apologized Thursday for President Trump's speech at the Scouts' annual jamboree, saying it "was never our intent" to inject politics into the event.

"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," Chief Scout Executive Michael Surbaugh wrote Thursday. "We sincerely regret that politics were inserted into the Scouting program."

Mr. Trump addressed a crowd of about 40,000 at the 2017 National Jamboree in West Virginia on Monday, repeatedly mentioning several hot-button political issues. He criticized former President Barack Obama, discussed ongoing efforts in Congress to repeal and replace Obamacare, reflected on his electoral victory and blasted the "fake media."

Get Breaking News Delivered to Your Inbox

"I go to Washington and I see all these politicians, and I see the swamp," Mr. Trump told the crowd. "And it's not a good place. In fact today I said we ought to change it from the word 'swamp' to the word 'cesspool' or, perhaps, to the word 'sewer.' But it's not good. Not good."

President Trump waves after speaking to Boy Scouts during the National Boy Scout Jamboree at Summit Bechtel National Scout Reserve in Glen Jean, West Virginia, on July 24, 2017. Getty

Parents and former Scouts were alarmed by the president's pointedly partisan remarks and the reaction of the crowd, which at one point booed when Mr. Trump mentioned Mr. Obama, who also addressed the gathering as president.

Surbaugh wrote Thursday that the gathering was overshadowed by the president's remarks and the ensuing backlash. He noted that presidents had been invited to speak at the gathering since 1937, and the president traditionally serves as the honorary president of the Boy Scouts of America.

Surbaugh said the Scouts' invitation to Mr. Trump was "in no way an endorsement of any person, party or policies."

"For years, people have called upon us to take a position on political issues, and we have steadfastly remained non-partisan and refused to comment on political matters," Surbaugh wrote.

When asked about Surbaugh's comments during Thursday's press briefing at the White House, deputy press secretary Sarah Huckabee Sanders rejected the suggestion that the president owes the Scouts an apology.

"I was at that event and heard nothing but a lot of cheering," Sanders said. "I haven't seen the statement from the Boy Scouts, so I can't comment any further than what I saw firsthand."