The foreign secretary met his counterpart, Hekmat Karzai, to discuss extremism, the upcoming Afghan elections and human trafficking, according to the country's ministry of foreign affairs.
Mr Johnson, a long-standing opponent of Heathrow expansion, had been given permission to be out of the country for the vote, where Conservative MPs face a strict three-line whip to back the plans.
However the government initially refused to disclose any details of his whereabouts, amid a storm of speculation, citing security concerns.
The mystery was solved when the Afghan ministry of foreign affairs tweeted images of Mr Johnson and its deputy foreign minister, Mr Karzai, at its office in Kabul.
A statement on its website said: "After the usual formalities, deputy foreign minister Karzai appreciated the role and sacrifices of British forces for peace and stability in Afghanistan, and thanked for the British cooperation in various political and economic spheres with Afghanistan.
"Both sides discussed and exchanged views on the recent decision of the Islamic Republic of Afghanistan on ceasefire, Afghanistan-Pakistan Action Plan for Peace and Solidarity, joint struggle with extremist elements and extremism phenomenon in the region, holding the next parliamentary and presidential elections of Afghanistan, support the education of girls; Afghanistan’s inclusion in action plan to prevent forced labour, modern slavery and human trafficking, and the Afghan-led and Afghan-owned peace process with oppositions."
The visit comes as MPs prepared for a late-night vote on the divisive project, which could create thousands of new jobs and capacity, but critics oppose over environmental, noise and financial concerns.
Mr Johnson had previously told anti-expansion protestors that he would "lie down with you in front of bulldozers" to prevent a new runway being built, as the major transport hub is close to his Uxbridge and South Ruislip constituency.
But under collective responsibility, cabinet ministers must vote with the government on key issues - meaning he would have to resign if he wanted to oppose the project.
International trade minister Greg Hands stood down last week so he could vote against the third runway, despite reportedly being offered the chance to go overseas on official business so he could miss the vote.
Mr Hands took a swipe at his Tory colleague on Sunday, tweeting: "Great to arrive back in the UK at Luton Airport in time for the [England] match today and to vote against Heathrow expansion tomorrow.
"I wouldn't want to be abroad for either of those commitments."
The Chelsea and Fulham MP told BBC Radio 5 Live: "I was clear from the beginning, and made it clear from the beginning, that I would be voting against and that any option to be somewhere else was not going to be viable for me, because of the very clear pledge that I have made to my electors in Chelsea and Fulham, which could hardly have been clearer."
Prominent Tory backbencher Sarah Wollaston said he should have resigned "on a point of principle" and it would be an opportunity to "put his money where his mouth is".
"Just being conveniently out of the country I'm afraid won't wash," she told BBC Radio 4's Westminster Hour.
Former Tory cabinet minister Justine Greening also took aim at Mr Johnson, tweeting: "Great you're back Greg [Hands]!
"I wouldn't want any long-term MP campaigners against Heathrow expansion to miss their chance to represent their community. #commitment #bulldozer."
Jeremy Corbyn, the Labour leader, said: "I would have thought, if nothing else, as a constituency MP he would want to be in the Commons because, after all, his constituency is very, very near to Heathrow, and he has in the past made very strong statements against Heathrow, and, indeed, once he promised to lie down in front of a bulldozer on it.
"If he is unable to be present, then we have to ask the question 'what on Earth is he doing and who is he representing?"
However Mr Johnson hit back at his critics, saying he had been urged by local councillors to carry on in office so that he could continue to fight the project from within Theresa May's top team.
"I have long been an opponent of a third runway at Heathrow and that is why I am not voting for it tonight," he said in an open letter to his constituents.
"I have made clear my opposition since joining the Government, and I will continue to lobby colleagues from within government.
"Some of my critics have suggested that I should resign over the issue. No doubt they have my best interests at heart.
"But it is clear from what is likely to be a large majority of MPs who are in favour of a third runway that my resignation would have achieved absolutely nothing."
The "considerable difficulties" facing the project mean it could be a long time before a third runway is ever built, he said.
Ms May originally said that ministers with long-standing objections to the Heathrow expansion would be allowed to continue to oppose it at a local level but would not be permitted to speak out in parliament.
The government is expected to win the vote on Monday as Labour has allowed its MPs to have free rein - despite saying the third runway plan failed to meet its environmental tests.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies