The inquiry, by a senior lawyer, was set up by Prime Minister Rishi Sunak after eight formal complaints about Mr Raab's behaviour as a minister.
The lawyer made multiple findings that fit a description of bullying in a report submitted to Mr Sunak.
Mr Raab said the inquiry was "flawed and sets a dangerous precedent".
The senior Conservative MP said he would quit the government if the inquiry by senior lawyer Adam Tolley KC made any finding of bullying against him whatsoever.
The bullying complaints, which involved 24 people, relate to Mr Raab's previous periods as justice secretary and foreign secretary under Boris Johnson, and his time as Brexit secretary under Theresa May.
Mr Tolley's report concluded Mr Raab had engaged in an "abuse or misuse of power" when foreign secretary, and "acted in a manner which was intimidating" towards officials at the Ministry of Justice.
In a resignation letter to Mr Sunak, Mr Raab said the inquiry "dismissed all but two of the claims levelled against me".
He said he feared the inquiry would "encourage spurious complaints against ministers, and have a chilling effect on those driving change on behalf of your government - and ultimately the British people".
In a letter to Mr Raab, Mr Sunak said his former deputy had kept his word after "rightly" undertaking to resign if the report made any finding of bullying whatsoever.
But the prime minister said he thought there had been "shortcomings" in the process and had asked civil servants to look at how complaints are handled.
The prime minister's spokesperson said Mr Sunak did not regret appointing Mr Raab to be his deputy.
The resignation of Mr Raab - one of Mr Sunak's key supporters during the Conservative leadership contest last year - triggered a mini-reshuffle of Mr Sunak's top team.
Mr Sunak has promoted two of his closest allies - Oliver Dowden as deputy prime minister, and Alex Chalk justice secretary - to fill the posts left vacant by Mr Raab.
Mr Raab's political fate had been hanging in the balance for about 24 hours after the prime minister received the report from Mr Tolley on Thursday morning.
Mr Raab's resignation is the third departure of a cabinet minister since Mr Sunak became prime minister.
A Downing Street source said Mr Sunak did not urge Mr Raab to resign.
Labour has accused Mr Sunak of being weak for failing to sack Mr Raab.
"We've had 13 years of Tory PMs trying to dodge the rules and defend their mates," a Labour source said. "Enough is enough."
The Liberal Democrats said Mr Raab's resignation should trigger a by-election for his Esher and Walton seat, in Surrey, calling him "unfit to represent his constituents in Parliament".
In his conclusions, Mr Tolley said he found a description of bullying had been met, when Mr Raab was foreign secretary and justice secretary.
The High Court in 2021 defined bullying, and confirmed that harassment, bullying and discrimination was not consistent with the Ministerial Code and was not to be tolerated, as Mr Tolley points out in his report.
Mr Tolley said Mr Raab had "acted in a way which was intimidating, in the sense of unreasonably and persistently aggressive conduct in the context of a work meeting", and that his behaviour involved "an abuse or misuse of power in a way that undermines or humiliates".
Mr Tolley also said, at meetings with policy officials, Mr Raab "acted in a manner which was intimidating, in the sense of going further than was necessary or appropriate in delivering critical feedback".
Mr Raab was "also insulting, in the sense of making unconstructive critical comments about the quality of work done (whether or not as a matter of substance any criticism was justified)", Mr Tolley said.
He said Mr Raab "did not intend by the conduct described to upset or humiliate", nor did he "target anyone for a specific type of treatment".
Mr Raab pulled no punches in his resignation letter. He made that clear that, while he accepted the outcome of the inquiry, he did not agree with the findings against him.
He said ministers "must be able to give direct critical feedback on briefings and submissions to senior officials, in order to set the standards and drive the reform the public expect of us".
While he apologised for any "unintended" stress caused, he attributed this to the "pace, standards and challenge" he brought to the Ministry of Justice.
"In setting the threshold for bullying so low, this inquiry has set a dangerous precedent," Mr Raab wrote.
His main argument appears to be that ministers need to be able to give direct critical feedback, and exercise direct oversight, over their civil servant officials.
One question now is whether he decides to take any further action.
He has punchily accused some civil servants of "systematic leaking of skewed and fabricated claims" and claimed a senior official initiated a "coercive removal" of some of his private secretaries last year.
Someone who advised Mr Raab in a senior role in one department told the BBC his resignation letter contained "one of the best examples of a 'non-apology' from a minister in recent years".
The person said Mr Raab's version of being the deputy prime minister "is one that should be learnt from and ultimately consigned to the history books".
A senior Tory MP and former Cabinet minister said: "Has Dominic Raab been hard done by? Certainly. Is he the victim of a civil service union ambush? Probably."
The FDA, a union that represents civil servants, has called for an independent inquiry in to ministerial bullying following the Raab investigation.
FDA General Secretary Dave Penman said Mr Raab's resignation was a "damning indictment" of the process for enforcing ministerial standards within government.