Kent's decision to give the new ball to former Pakistan all-rounder Azhar Mahmood reaped three late wickets and left Division Two leaders Gloucestershire facing a last day County Championship defeat at Beckenham.

Home skipper Rob Key elected to promote Mahmood ahead of the off- colour Ryan McLaren and reaped immediate rewards as the 34-year-old bagged three for 11 to leave Gloucestershire on the slide at 131 for five going into the fourth and final day.

Having been set an unlikely target of 332 in a minimum 150, Gloucestershire made an uncertain start when left-handed opener William Porterfield miscued an attempted pull against Mahmood into the hands of mid-off.

After tea England A off-spinner James Tredwell had Kadeer Ali (38) caught at slip off an arm ball then, 28 runs on, Alex Gidman (12) shouldered arms to go leg before and make it 107 for three.

With their two best batsmen at the crease Gloucestershire needed to get through to stumps without further loss, but Mahmood returned to square up Hamish Marshall's back foot defensive push, find the edge to second slip, and send him packing for 45.

Then, three overs from the close, Craig Spearman went for leg before for 13 after playing across the line to a Mahmood leg-cutter.

Incapacitated by a suspected fractured right index finger, Spearman trudged off and Gloucestershire's victory hopes probably went with him.

Kent, resuming on 149 for six and a lead of 214, started the day knowing they would need to bat well beyond lunch if they were to take the game into its fourth and final day and after an hour's play that looked well beyond them.

Within 15 overs they had lost three more wickets and leaders Gloucestershire were beginning to scent their fourth win in seven starts thus far, until the hosts finally found their batting mettle through 10th wicket partners Simon Cook and McLaren.

Earlier Steven Kirby took his first five-wicket haul of the summer by pinning night watchman Amjad Khan (5) lbw on the back foot , then Banerjee accounted for Justin Kemp (41) with his first ball, a short one that sat up only for Kemp to slap it straight to cover.

A below-par Jonathan Lewis then secured his only scalp of the innings by having Tredwell (6) caught off a virtual half-volley that the left- hander obligingly clipped to mid-on to bring together Cook and McLaren.

The pair batted a shade over an hour and forty minutes together either side of lunch to add 87 in 25 overs - a Kent record for the last wicket against Gloucestershire beating the 77 of CS 'Father' Marriott and Leslie Todd scored at Canterbury in 1929.

Cook was the more aggressive of the two, hitting six fours in his unbeaten 40 from 92 balls, while McLaren hit the ropes just four times in his 42 only to meekly turn a ball off his legs to mid-wicket and give Vikram Banerjee impressive figures of four for 58.