KABUL (Reuters) - British Foreign Secretary Boris Johnson dismissed suggestions on Saturday that Britain's exit from the European Union and the election of Donald Trump as U.S. president would lead to Western powers withdrawing from engagement with the rest of the world.

Speaking during an overnight visit to Kabul that included meetings with President Ashraf Ghani and Chief Executive Abdullah Abdullah, Johnson said Britain remained committed to Afghanistan "for the long haul".

As well as continued support for the NATO-led Resolute Support mission to train Afghan security forces, it was doing "a hell of a lot" for aid and development in Afghanistan, in areas like education, he said.

"None of those will be affected by our relations with the treaties of the European Union, as you would expect," he said.

Britain's June 23 vote for 'Brexit' and Trump's backing for an "America First" foreign policy have triggered alarm among some commentators who see signs of increasing isolationism among Western powers. However Johnson, one of the leaders of the pro-Brexit camp, rejected such fears.

"If the question is do I think that the western world is going to start withdrawing or turning in on itself, then the answer is emphatically no, I don't think so," Johnson told reporters. "That certainly won't be the situation with the United Kingdom."

"We intend to be more engaged with the world, more outward-looking than ever before," he said.

"I think we'll have to see how things pan out in Washington but I think that the interest of the United States in the security and stability of this part of the world will remain fundamental."

Johnson visited Kabul University, where he attended a performance of a scene from Shakespeare's tragedy Macbeth in Dari, as well as the British cemetery, with its memorial to more than 450 British soldiers killed in Afghanistan.

He said Britain could be proud of the sacrifices and achievements of its troops, despite the deteriorating situation in areas like Helmand, now in large part under Taliban control, where more British soldiers died than in any other province.

"No one is sitting here and pretending that things are perfect but they are better by far than they were," he said.

"There are many ways that in spite of all the difficulties and all the challenges, this place is better for the help that we have tried to give it over the years," he said.

(Reporting by James Mackenzie; Editing by Mark Trevelyan)