Boris Johnson will be investigated by a Commons committee over claims he misled Parliament about parties in Downing Street during lockdown.
MPs approved the Privileges Committee launching an inquiry once the police have finished their own investigation into the gatherings.
The government had tried to delay the vote, but made a U-turn following opposition from its own MPs.
Mr Johnson said he had "absolutely nothing, frankly, to hide".
Speaking during an official trip to India, the prime minister added: "If the opposition want to focus on this and talk about it a lot more, that's fine."
Last week, the prime minister - along with his wife and the Chancellor Rishi Sunak - was fined for breaking Covid laws by attending an event in Downing Street to celebrate his birthday.
So far the police have announced they have issued at least 50 fines as part of their investigation.
Mr Johnson had previously told MPs laws were not broken in Downing Street, leading to accusations from opposition parties that the prime minister had misled them.
Under government guidelines, ministers who knowingly mislead the House of Commons are expected to resign.
Labour leader Sir Keir Starmer called the government's U-turn a "humiliating climb-down" that showed Tory MPs "know they can no longer defend the indefensible".
Speaking after the vote, he added: "Boris Johnson has lost the trust of the public over parties held in Downing Street during lockdown.
"Now it's clear he has lost the confidence of his MPs."
'Orgy of adulation'
Urging MPs to support an investigation, Liberal Democrat leader Sir Ed Davey said: "The public won't stomach another Conservative stitch-up that drags our democracy through the mud just to protect one of their own."
SNP Westminster leader Ian Blackford said Mr Johnson had "lied to avoid getting caught, and once he got caught, he lied again".
Senior Conservative backbencher Steve Baker accused Mr Johnson of indulging in an "orgy of adulation" and "a festival of bombast" on Tuesday, shortly after apologising to MPs for his rule-breaking.
He said the prime minister's "contrition had only lasted as long as it took to get out of the headmaster's study" and that he should be "long gone".
After more than five hours of debate, MPs were asked if they supported launching an investigation into Mr Johnson.
No one opposed the proposal, so the motion was approved without a formal vote.
What will the Privileges Committee do?
The Privileges Committee will investigate and produce a report stating whether or not they believe Mr Johnson did deliberately mislead Parliament.
If they find Mr Johnson did mislead Parliament, they can recommend a sanction which could include a suspension or expulsion from Parliament entirely. They could also recommend he apologises to the House.
MPs will then decide whether or not to approve the report and implement the recommended sanctions.
The Privileges Committee is made up of seven MPs - two Labour MPs, one Lib Dem and four Conservatives.
However, the committee chair - Labour's Chris Bryant - has recused himself from the investigation as he had already commented publicly on the matter.
The last time the committee found an MP to be in contempt of Parliament was in 2016 when it recommended suspending Justin Tomlinson for two days after he leaked a select committee report to the payday lending company Wonga.
What has the PM told MPs about parties?
When asked whether there was a party in Downing Street on 18 December 2020, the PM told the Commons on 1 December 2021 that "all guidance was followed completely in No 10".
After the publication of a video showing No 10 staff joking about the 18 December event, he told MPs on 8 December 2021 he had been "repeatedly assured" that "there was no party and that no Covid rules were broken".
Later that day, he told the Commons he was "sure that whatever happened, the guidance was followed and the rules were followed at all times".
On 12 January 2022, he apologised for attending a Downing Street garden party on 20 May 2020 but said he had "believed implicitly" it was a work event.