Jeremy Corbyn has said it would have been the "right thing" to arrest the Islamic State leader Abu Bakr al-Baghdadi if it had been possible.
Baghdadi killed himself during a US military operation in Syria last month.
Speaking to LBC, the Labour leader said Baghdadi's removal was "a very good thing" but "if it's possible to arrest somebody and put them on trial then that is what should have been done".
Boris Johnson called his words "naive to the point of being dangerous".
The Conservative leader said he had not heard Mr Corbyn's LBC interview, but asked about the Labour leader's remarks at a press conference, he said: "It's very important when we look at the threats this country faces that we are realistic about what we must do to be strong in the face of those threats."
He said Baghdadi was an "absolutely diabolical foe of this country and our liberal values", adding that it was "not realistic to suggest he could be apprehended by the police in the circumstances he was finally run to ground".
The Islamic State group (IS) carried out multiple atrocities that resulted in thousands of deaths.
The jihadist group imposed a brutal rule in the areas under its control and was behind many attacks around the world. Although the US declared the "caliphate" defeated earlier this year, IS militants remain active in the region and elsewhere.
During the Labour leadership campaign in 2015, Mr Corbyn was criticised for saying it was a "tragedy" that al-Qaeda chief Osama Bin Laden was killed rather than being put on trial. The remarks were made in 2011.
When Mr Corbyn was asked by LBC whether he also considered the the death of Baghdadi a tragedy, he replied: "If we preach internal law and international legal process through the international court of justice and The Hague, then we should carry out.
"And if it's possible to arrest somebody and put them on trial, then that is what should have been done and that is what I said about the death in 2011 and will continue to be my principle.
"If we believe as we do in international law and justice and the power of the international court of justice then we should do everything we can to bring people where they deserve to go on trial to be put on trial."
When asked whether the death of Baghdadi was a good thing, Mr Corbyn replied: "Him being removed from the scene is a very good thing.
"If it would have been possible to arrest him, I don't know the details of the circumstances at the time, I've only seen various statements put out by the US about it - surely that would have been the right thing to do.
"If we want to live in a world of peace and justice, we should practice it as well."
In October, US President Donald Trump said Baghdadi detonated his suicide vest after fleeing into a tunnel, chased by US military dogs.
Baghdadi came to prominence in 2014, when he announced the creation of a "caliphate" in areas of Iraq and Syria.