Iain Duncan Smith, a former party leader, led a Commons revolt over the government plan backing a bid to rid the UK’s network of the Chinese telecoms giant’s involvement by 2022.
The Tory, rebels which included a number of senior Brexiteers, did not have the numbers to force Johnson to change course and the government won the vote 306 to 282 - but with a majority of only 24.
But they handed the prime minister his first bloody nose of the parliament despite culture secretary Oliver Dowden offering a number of concessions.
It spells trouble for Johnson, who is expected to bring forward the Telecommunications Security Bill, writing the contract into law, by the summer.
Critics of the 5G plan say that Huawei is an arm of the Chinese state and therefore could present a risk to UK security.
US president Donald Trump is also said to be extremely unhappy at Johnson’s decision.
But the government insists the Chinese firm will be excluded from the most sensitive parts of the 5G network and that its overall market share will decline over time as new players emerge.
Duncan Smith said: “We are genuinely concerned that this country has got itself far too bound into a process in which we are reliant on untrusted vendors and in this particular case, Huawei.
“But let’s not be in any doubt at all, the one thing I do want to say is that we heard recently that it is the view, and a government minister said this, that Huawei was a private company. Let us be very clear absolutely from the outset, this company is not a private company.
“It ends up being essentially almost completely owned by Chinese trade unions and they of course are exactly locked into the Chinese government. This is a Chinese wholly-owned organisation.”
A number of the rebels, which included including senior MPs such as Liam Fox, Bob Seely, Steve Baker and European Research Group chairman Mark Francois, took to Twitter after the vote to pressure the government further.
Dowden used the debate to tell MPs there was a “path to diversification” which would see Huawei’s involvement decline. But he failed to give a firm commitment to a date.
“There is a huge sense of urgency in this,” he said.
“This is why we are committed to working with our Five Eyes partners to make sure in this parliament – we are setting for the first time here – we are setting out a timetable to say within this parliament we will get the capacity so that then we can ensure that we will start to move away from our reliance on high-risk vendors.
“It’s already capped at 35%, we want to get to a position where we don’t need to rely on them at all.
“This is the important first step and this is about reassuring the House that we are on the path to diversification.”
Before the debate, Dowden had also written to Tory MPs offering assurances and meetings with security officials in a bid to allay concerns.
“I wish to stress again that the government is clear-eyed about the challenges posed by Huawei,” he said.
“That is why the National Security Council made a decision to: exclude them from the security critical network functions in 5G networks, and reduce their presence in other network functions up to a strict market share cap of 35%.”
Dowden also said it was “not the right bill” for the rebels to use in their protest against Huawei.
“Parliament will be able to express its views on the controls on high-risk vendors when the government brings forward the legislation to introduce the new telecoms security regime,” he told them.
“The Telecommunications Security Bill will be brought forward by this summer.”
Experts from the National Cyber Security Centre will give evidence to parliamentary committees as part of the process around the legislation, he said.
Dowden also offered “further technical briefings” for MPs.