Hammell netted his second goal of the season after 22 minutes when he rocketed the ball beyond Jason Brown after collecting Tom Hateley's pass.
Victory for the Fir Park side moves them level on points with second-placed Rangers, but the SPL champions currently have a better goal difference.
Aberdeen began the match hoping to record their second win at Fir Park in six days and they created the first chance of the match in the opening minute. Scott Vernon cut the ball back to Gavin Rae, who fired high over the bar.
Vernon blazed an effort over in the 13th minute, before the hosts created their first chance as Michael Higdon rose to meet Hammell's cross but the striker was adjudged to have fouled Andrew Considine.
Considine became the first player to be booked in the 15th minute when he clumsily brought down Henrik Ojamaa as the Estonian raced through on goal.
Motherwell grabbed the only goal midway through the first half when Hammell collected Hateley's pass and blasted a wonderful 30-yard strike beyond Brown in the Aberdeen goal.
Buoyed by their opener, Motherwell looked for a second goal and Considine had to be alert to head clear Chris Humphrey's dangerous cross.
Stuart Carswell forced Brown into an excellent stop with his feet as Motherwell looked to double their lead.
Humphrey was proving to be a constant threat to the Aberdeen defence and only an excellent clearing header by Rory Fallon prevented Ojamaa seizing on the winger's excellent delivery.
Steve Jennings passed up an excellent opportunity to extend the hosts' advantage four minutes before the break when he connected with Humphrey's cross, but his header was comfortably gathered by Brown.
Considine fired well over after meeting Clark Robertson's corner on the stroke of half-time as the visitors created their best opportunity of the opening 45 minutes.
Carswell forced Brown into an excellent save in the opening minute of the second half after some neat build-up play between Ojamaa and Nicky Law.
A wonderful Darren Randolph stop denied Vernon an equaliser just before the hour mark at the other end. Robertson's cross was well controlled by the striker, but his close-range effort was somehow parried away by the Well goalkeeper.
The hosts came close to adding to their lead when Brown parried Humphrey's stinging effort and only an excellent block by Considine prevented Higdon netting the rebound.
Substitute Mitchel Megginson fired well wide as Aberdeen looked to find a way back into the match, but the Dons were struggling to trouble the Motherwell rearguard.
Humphrey sliced a shot wide of the target as Motherwell continued to press for a crucial second goal in the closing stages.
The Jamaican winger should have done better with two minutes left in the match when he fired a shot straight at Brown despite Law being well placed for a cutback.
Deep into injury-time Rory McArdle was booked for a poor challenge on Robert McHugh and the Fir Park side played out the remaining minute of injury time to gain a crucial three points.