LONDON — President Trump, viewed by many here as an American bull in the proverbial china shop, was relatively diplomatic Tuesday, promising to “stay out” of British politics, just 10 days before a general election.

But he couldn’t quite help himself.

In the same breath, Trump declared that his ally Prime Minister Boris Johnson is “very capable and I think he’ll do a good job” if elected Dec. 12.

As for Johnson’s opponent, Labour Party leader Jeremy Corbyn, the president on Tuesday said, “I can work with anybody.”

Trump was in London to mark the 70th anniversary of the NATO alliance — an event choreographed to limit destabilizing interventions by the U.S. president. In the course of the day Tuesday, Trump turned three scheduled photo opportunities with NATO leaders into freewheeling news conferences. But he spent more time sparring with French President Emmanuel Macron than he did messing with the Brits.

Unlike Trump’s last trip to London, this is not an over-the-top state visit. There has been some pomp — but not oodles of it.

On Tuesday night, there was a crowded reception at Buckingham Palace. Trump got some face time with the queen but had to share her majesty with dozens of others.

Trump also had tea on Tuesday with Prince Charles and his wife, Camilla, Duchess of Cornwall. The president and first lady Melania Trump arrived late.

The two couples posed for photographs in front of a roaring fireplace. Vanity Fair magazine noted that “everyone was clashing,” meaning that Melania Trump was in a yellow and purple Valentino cape, Camilla in a red dress, Trump in a black suit and Charles in navy.

In the past, Trump and Prince Charles have also clashed a bit on climate change. Charles is a passionate advocate for environmental preservation. Trump has famously suggested that climate change is a Chinese hoax.

On Tuesday, when asked about climate change in a joint appearance with Canadian Prime Minister Justin Trudeau, Trump professed: “I think about it all the time. Honestly, climate change is very important to me.”

Trump talked about wanting “crystal-clear clean water and clean air” and about his concern that countries are dumping “unlimited loads of things” into the oceans that “tend to float toward the United States.”

But when asked about rising sea levels, Trump changed the topic to nuclear proliferation.

In another photo-op-turned-news-conference, Trump was asked whether he thought that Britain’s government-run National Health Service should be on the table in future U.S.-British trade deals.

“No, not at all, I have nothing to do with it. Never even thought about it, honestly,” Trump said.

“I don’t even know where that rumor started. We have absolutely nothing to do with it, and we wouldn’t want to if you handed it to us on a silver platter. We want nothing to do with it.”

The rumor may have started with Trump and his ambassador to Britain, Woody Johnson, the owner of the NFL team the New York Jets.

Woody Johnson told the BBC on June 2 that all areas of the British economy, including the NHS and food, would be “on the table” in any future trade talks.

Trump echoed the point two days later. When asked during a news conference in London whether the NHS would be in play in a possible trade deal with the United States, Trump said, “When you’re dealing on trade, everything is on the table — so NHS or anything else, and a lot more than that. Everything will be on the table, absolutely.”

Trump has since backtracked, possibly aware of what a hot-button issue this is in Britain.

Boris Johnson on Tuesday stated that he could “categorically rule out” that “any part of the NHS will be on the table in any trade negotiations.”

The prime minister also dismissed Corbyn’s warning that Johnson and Trump had formed an alliance to sell out the NHS as “pure Loch Ness Monster, Bermuda Triangle stuff.”

But anti-Trump protesters in London on Tuesday said they did not trust the American president.

Mark Boothroyd, 34, a nurse, said he worried that Trump and U.S. companies would conspire to get access to Britain’s NHS, one of the largest health providers in the world.

“We can see Trump is an ally of Boris Johnson. [Johnson] has praised him, and Trump has praised him back, saying they call him ‘Britain Trump.’ These are close political allies, and they know well enough what not to say to upset the other in a tight election,” Boothroyd said.

Several thousand protesters gathered along the route Trump traveled, ending their appearance with a mass demonstration outside Buckingham Palace, where they shouted: “What do we want? Trump out! When do we want it? Now!”

Simon Fell, 64, an artist who was protesting in London’s Trafalgar Square, said, “I don’t think that Donald Trump should be welcomed in this country.”

Fell said that if Johnson and his Conservatives win the election next week, they could negotiate a trade deal with the United States that would increase the cost of medicines in Britain.

The U.S. president is extremely unpopular in Britain, and Johnson, in the closing days of campaigning for an election he is forecast to win, has sought to keep Trump at arm’s length.

On Friday, Johnson tried to dissuade Trump from offering his opinions on domestic affairs. “What we don’t do traditionally as loving allies and friends, what we don’t do traditionally, is get involved in each other’s election campaigns,” Johnson told LBC radio.

Trump at least showed more restraint Tuesday than he did a month ago, when, during a call-in to Brexit Party leader Nigel Farage’s radio show, Trump warned Britain that Corbyn would be “so bad for your country, so bad.”

Asked whether Trump’s support was a possible embarrassment, Johnson said, “On the contrary, and I have good relations with Washington, the president, with President Macron, Chancellor Merkel, and that’s vital for the U.K. And we’ll be having a series of meetings — bilateral, trilateral, of all kinds — in the course of the next couple of days.”

Trump had told reporters that he would be speaking to Johnson at 10 Downing Street, the prime minister’s official residence. And on Tuesday evening, after Buckingham Palace, Trump and other NATO leaders attended a reception there.

The schedule did not show a one-on-one meeting between Trump and Johnson.