Harlequins still had time for a comeback, Care darting over after Harlequins appeared to be setting up a maul, converted by Smith to draw Harlequins within seven.
They soon piled on more pressure, with Kirby Myhill sin-binned. Smith’s dancing footwork after minutes of scrum pressure made the difference, powering over and converting to level the score at 33-33 with four minutes left.
There was still time for a twist, and after Cardiff dithered in their own half, Harlequins pounced for the winning penalty at the breakdown, knocked over by Smith to secure victory.
Scoring sequence: 0-5 Lynagh, 0-7 Smith con, 5-7 Lane try, 7-7 Evans con, 12-7 Ratti try, 14-7 Evans con, 14-12 Green try, 14-17 Northmore try, 14-19 Smith con, 19-19 Lewis try, 21-19 Evans con, 26-19 Lane try, 31-19 Domachowski try, 33-19 Evans con, 33-24 Care try, 33-26 Smith con, 33-31 Smith try, 33-33 Smith con, 33-36 Smith pen
Cardiff: H Amos; O Lane (T Myhill 72), R Lee-Lo, W Halaholo (B Thomas 50), J Adams; J Evans (R Priestland 76), T Williams (L Williams 78); R Carré (C Domachowski 50), K Myhill, D Arhip (D Lewis 48), J Turnbull (c), S Davies, S Lewis-Hughes, E Jenkins (W Boyde 70), J Ratti
Not used: R Thornton
Yellow card: D Arhip 40, K Myhill 73
Harlequins: T Green; L Lynagh, J Marchant, L Northmore (H Jones 51), C Murley; M Smith, D Care; J Marler (S Garcia Botta 77), J Walker (S Riley 77), W Collier (S Kerrod 55), M Symons, D Lamb, V Taulani (A White 51), T Lawday (H Tizard 55), A Dombrandt (c)
Not used: J Stafford, W Edwards
Yellow card: A Dombrandt 53
Referee: T Trainini (FRA)