Sir Keir Starmer mocked the Prime Minister along with foreign secretary Dominic Raab after they both went on holiday despite the ongoing Taliban takeover of the country.
Mr Johnson’s comments came during an emergency debate in Parliament in which the Prime Minister defended the final pull-out of British troops, saying it was an “illusion” to think the international military mission could have continued without US forces.
Sir Keir also criticised Mr Johnson for not visiting Afghanistan since he became Prime Minister and pointed out his last visit while foreign secretary was to avoid a vote on Heathrow.
The Labour leader told the Commons: “Hundreds of thousands of British people have flown to Afghanistan to serve, the Prime Minister flew to avoid public service.
Sir Keir said MPs on both sides of Commons warned in July the UK Government “may be underestimating the threat of the Taliban”.
He went on: “That was ignored. The Prime Minister’s response to the Taliban arriving at the gates of Kabul was to go on holiday.
“He [Raab] shouts now, but he stayed on holiday while our mission in Afghanistan was disintegrating. He didn’t even speak to ambassadors in the region as Kabul fell to the Taliban.
“You cannot co-ordinate an international response from the beach.
"[It was] a dereliction of duty by the Prime Minister and the foreign secretary, a government totally unprepared for the scenario that it had 18 months to prepare for.”
“No sense of the gravity of the situation, not leadership to drive international efforts on the evacuation.”
Both Mr Raab and Mr Johnson cut short their holidays over the weekend.
Opening the debate, Mr Johnson promised to do "everything to support" those who helped the UK, including taking 20,000 refugees.
He continued: “As for our Nato allies and allies around the world, when it came for us to look at the options that this country might have in view of the American decision to withdraw we came up against this hard reality.
“That since 2009, America has deployed 98 per cent of all weapons released from Nato aircraft in Afghanistan and at the peak of the operation – where there were 132,000 troops on the ground – 90,000 of them were American.
“The West could not continue this US-led mission, a mission conceived and executed in support of America.
“I really think that it is an illusion to believe that there is appetite amongst any of our partners for a continued military presence or for a military solution imposed by Nato in Afghanistan.
“That idea ended with the combat mission in 2014.
“And I do not believe that today deploying tens of thousands of British troops to fight the Taliban is an option that no matter how sincerely people may advocate it – and I appreciate their sincerity – but I do not believe that that is an option that would commend itself either to the British people or to this House.
“We must deal with the position as it is now is, accepting what we have achieved and what we have not achieved.”
Mr Johnson promised the UK would work to unite the international community behind a “clear plan” and urged other countries not to recognise the new regime “prematurely”.
He said: “We will judge this regime based on the choices it makes and by its actions rather than by its words, and on its attitude to terrorism, to crime and narcotics, as well as humanitarian access and the rights of girls to receive an education.
“Defending human rights will remain of the highest priority.
“And we will use every available political and diplomatic means to ensure that those human rights remain at the top of the international agenda.”
The crisis sparked fierce reactions from across the House, with a host of MPs lining up to criticise Mr Johnson and US president Joe Biden.
Labour MP Chris Bryant asked: “The home secretary announced this morning that 20,000 – that the UK will be taking 20,000 refugees from Afghanistan – but that only 5,000 will be able to come this year.
"What are the 15,000 meant to do? Hang around and wait until they have been executed?”
SNP Westminster leader Ian Blackford accused Mr Raab of having “no dignity whatsoever” and “lying on a sunbed” as the Afghanistan crisis unfolded.
Mr Blackford told the Commons that Scotland “stands ready to play its full part” in resettling Afghan refugees, and called for a "fundamental change” in the UK Government’s approach.
He said: “It is important to say that if we are to support the Afghan people, then this crisis needs to mark a point of fundamental change in this government’s approach to refugees.
"In the past few months alone, this is a government which has introduced a hateful anti-refugee bill that would rip up international conventions.
“It is a UK Government that has spent a sizeable part of its summer, making political play from turning away migrants and refugees in small boats desperately making their way across the channel. That hostile attitude and approach to refugees already extends to Afghanistan.”
Former prime minister Theresa May said it was “a major setback for British foreign policy” nearly 20 years after UK forces first entered the country in the wake of the 9/11 terror attacks on the US.
She accused Mr Johnson of hoping “on a wing and a prayer it’d be all right on the night”.
Mrs May said: “We boast about global Britain, but where is global Britain on the streets of Kabul? A successful foreign policy strategy will be judged by our deeds, not by our words.”
Conservative MP Tom Tugendhat, a former soldier who served in Afghanistan, was applauded following an emotive Commons speech.
Accusing both the the West and the UK of lacking patience, he hit out at Mr Biden over comments made in Tuesday’s press conference.
He said: “To see their commander-in-chief call into the question the courage of men I fought with, to claim that they ran is shameful.
“This is a harsh lesson for all of us and if we’re not careful it could be a very, very difficult lesson for our allies.
“It doesn’t need to be. We can set out a vision, clearly articulate it, for reinvigorating our European Nato partners, to make sure that we are not dependent on a single ally, on the decision of a single leader, that that we can work together with Japan and Australia, France and Germany, with partners large and small and make sure we hold the line together.”
Conservative former foreign secretary Jeremy Hunt also criticised the US.
He said: “President Biden said this week that his only vital national interest in Afghanistan was to prevent a terrorist attack.
“Even if that is the case, both he and President [Donald] Trump should be deeply ashamed, and I say this with great sadness, because their actions have returned Afghanistan to the very government that harboured the 9/11 bombers.”
The Conservative chairman of the defence committee, Tobias Ellwood, said the collapse of Afghanistan was the result of “an operational and strategic blunder”.
He explained: “What we require is the backbone, the courage, the leadership to step forward, yet when our moment comes such as this we are found wanting.”
“We are complicit in allowing another dictatorship to form as we become more isolationist.”