LONDON — Boris Johnson, Britain’s top diplomat, with a reputation for undiplomatic comments, came under fire on Wednesday for telling an audience at the Conservative Party’s annual conference that the Libyan city of Surt, a former stronghold of the Islamic State, could become “the next Dubai” if the authorities could just “clear the dead bodies away.”

The comments came days after Mr. Johnson, the foreign secretary, publicly undermined Prime Minister Theresa May’s negotiating strategy on Britain’s departure from the European Union. And less than a week ago, he was criticized after a widely shared video showed him reciting a poem that celebrated British imperialism in Myanmar during a visit there in January.

Mr. Johnson was participating in a panel discussion in Manchester, England, on Tuesday when he began to praise Libya for its “bone-white sands, beautiful sea” and fine architecture, according to the BBC. He then turned his attention to plans by an unidentified group of British investors who he said wanted to turn Surt, the city where the former dictator Col Muammar el-Qaddafi was killed in 2011, into a world-class business hub, according to audio posted to Twitter by the BBC.