Dean Elgar signed off from professional cricket in style, scoring a composed century in the final innings of his career as Essex fought back against Glamorgan in the follow-on.

Essex reached 331 for 5 at the close of the third day, still trailing Glamorgan's first-innings total of 505 by 45 runs.

Elgar top-scored with a superb 108, registering the 57th first-class century of his career. The South African's final professional appearance brought the curtain down on a first-class career spanning two decades and 284 matches.

He found valuable support from Essex captain Tom Westley, with the pair adding 166 runs for the partnership. Westley contributed 65 before being dismissed by Ben Kellaway.

Essex had earlier been bowled out for just 129, leaving them 376 runs behind Glamorgan. All-rounder Zain-ul-Hassan produced career-best figures of 5 for 14, having taken four wickets against Surrey in the previous round.

Glamorgan enforced the follow-on after Essex's first innings ended inside the opening hour of the third day.

Conditions were more favourable for batting in Essex's second innings, with Elgar initially taking a cautious approach before settling into his trademark style of finding gaps and rotating the strike.

After Elgar and Westley were dismissed, Essex lost two more wickets as Kellaway and Mason Crane applied pressure. However, George Bell launched a late counterattack, reaching his half-century in just 42 balls.

Bell smashed four consecutive boundaries in the first over of the second new ball and remained unbeaten alongside Noah Thain, with their 65-run stand reducing Essex's deficit to 45.

Glamorgan remain in control heading into the fourth day, but Essex's determined fightback has ensured a much more competitive finish.