Compton made an inauspicious return to county ranks last week when he managed scores of zero and 16 against Surrey in his first domestic match of an Ashes summer.
But alongside former England opener Marcus Trescothick he put on a century stand before both men fell just prior to Somerset taking lunch at 113 for two.
Trescothick (51) was hit in front when Jeetan Patel's first ball straightened before Compton (52) was unlucky to follow the same way when he appeared to edge Rikki Clarke into his pad.
Surrey were bowled out for 351 on the second morning against Sussex at the Oval, with Chris Jordan claiming five for 92.
Australia opener Ed Cowan hit a half-century as Nottinghamshire threatened to take control against newly-promoted Derbyshire.
Cowan hit 59 and was the only man out as Notts reached lunch on 124 for one in reply to 256.
There was no play in the other top-tier match between Durham and Yorkshire at Chester-le-Street due to rain.
Yorkshire are 57 for three in reply to 253.
- Sports & Recreation
- Marcus Trescothick
- Jeetan Patel