After taking the two wickets they needed to dismiss Lancashire for 331, Nottinghamshire started on the front foot.
But Ben Slater’s second-over boundary turned out to be his only scoring shot as Saqib Mahmood, bowling for the first time in a senior match for 12 months following a stress fracture, had him caught at third slip.
Will Young was then bowled by Will Williams for 27 and Nottinghamshire looked in trouble when Joe Clarke and Tom Moores fell in quick succession, both caught behind off Balderson, to make it 104 for four.
But Jack Haynes joined Hameed and the pair put on 87 for the fifth wicket, during which the captain ended his long wait for a Championship hundred.
Hameed was promptly put down on 104, a difficult chance coming hard to Luke Wells at slip off Hartley, but Nottinghamshire nevertheless suffered another setback in the last over before tea when Haynes was bowled by Balderson for 35.
Lancashire made two more breakthroughs before the close but not before Lyndon James (26) and Calvin Harrison (21) had helped Hameed edge Nottinghamshire closer to the 300-run mark, and the home captain will look to continue accumulating on day three.
Report supplied by ECB Reporters’ Network.