The Omega Pharma - QuickStep rider was 15 seconds clear going into the 116km final stage and won it to take victory on GC.
Cavendish had to come from a long way back in the final kilometre to overhaul the leaders on the final straight, eventually pipping Yauheni Hutarovich to the line by just half a wheel as he crossed in three hours 24 minutes 31 seconds.
The ride capped off an extraordinary week for Cavendish, who won four consecutive stages as he claimed overall victory in what was only the former world champion's second race for the Belgian outfit.
"I'm over the moon," Cavendish said. "We come here every year almost guaranteed an overall victory with Tom Boonen, but he's recovering from an injury.
"So it put a little bit of pressure on me and I was a bit nervous. But I'm really happy to get the win. The guys worked incredible here. They really looked after me so, so well here and delivered every single day.
"I am so happy and proud I can bring it home again for the team again. We've won Tour of Qatar six times, and I don't know how many stages, so I am happy to be a part of that."
The Manxman's win came despite a minor crash just 15km into the final day.
"I tweeted this morning that I've won and crashed this stage before — the previous one — and the fact is I did both again," Cavendish said with a laugh. "I was just going along after 15km, came to a roundabout not going hard, just riding. I was riding on someone's wheel and he just went down. He doesn't even know what happened. But, that's bike racing. It was a freak accident. I'm a bit banged up, but I'm OK. I am just kind of twisted, but we'll get it sorted."
He had no fear that he would be able to win, however: Cavendish, who has few overall triumphs given that he is an out-and-out sprinter, started his Omega Pharma career at the Tour of San Luis in Argentina with one stage victory and he has been showering his team-mates with praise all week in Qatar and did so again on Friday.
"It was kind of like Al Khor, actually," Cavendish said of the final sprint, comparing his tactics to the victory of stage four.
"I knew the wind was coming from the right, knew a gap was coming from the left. Same as when I won in 2009. The same tactics. The guys were going, and going, and going. Other teams started winding up with four laps to go.
"Still, it ended up the same way with one lap to go. It's a bit safer into the last lap and everyone's happy. The guys had been a bit used up for working for me all day and the entire race, so I knew I can kind of just go alone, can leave it late and come up the left side again. That's exactly what I did. I knew they would go right, and I could just use other leadouts to move up in the last 300 meters and jump on the left hand side."
The 27-year-old was little more than a domestique in 2012 at Sky, who put all their efforts into securing a first British win at the Tour de France when Bradley Wiggins topped the podium ahead of compatriot Chris Froome.
Cavendish has 23 Tour de France stage wins to his name.
Stage six results:
1. Mark Cavendish (GBR) Omega Pharma-Quick-Step
2. Yauheni Hutarovich (BLR) Ag2R La Mondiale
3. Barry Markus (NED) Vacansoleil-DCM
4. Adam Blythe (GBR) BMC
5. Taylor Phinney (USA) BMC
6. Kenny Robert Van Hummel (NED) Vacansoleil-DCM
7. Alexander Kristoff (NOR) Katusha
8. Bernhard Eisel (AUT) Team Sky
9. Nacer Bouhanni (FRA) FDJ
10. Guillaume Boivin (CAN) Cannondale
- Sports & Recreation
- Omega Pharma
- Yauheni Hutarovich