The 23-year-old Kaymer became the youngest and first German winner despite his 3-over 75, finishing at 15-under 273. Hansen (67) birdied five of his last 11 holes.
Sharing third at 13 under were English players John Bickerton (67), Mark Foster (68) and Paul Casey (70).
Kaymer had a triple-bogey on the 11th hole but birdied the 18th to force a playoff. He won with a 200-yard approach shot that bounced within six feet of the cup.
I didnt want to lose here, this win was for my mother, said Kraymer, whose mother has a serious illness. After the 13th or 14th hole, I just kept fighting.
Kaymer fell a stroke behind Hansen after two bogeys and the triple-bogey' caused by his failed gamble to drive past the water trap to reach the green.
It was Kaymers second win after Abu Dhabi in January.