But this was an important result for the Dons, who had lost five out of their previous six games in all competitions and they now lie in ninth place in League One.
Walsall carved out the game's first real chance after 18 minutes when James Baxendale's through-ball played in Sam Mantom, who was denied by a good save from keeper David Martin.
Dons then came close as Patrick Bamford beat Richard O'Donnell to Lee Hodson's deep cross with the ball just dipping over the crossbar.
After sending an earlier attempt wide, Williams finally broke the deadlock in the 64th minute when his superb free-kick found the bottom corner via the post.
Mantom then fired a long-range effort wide for Walsall, but the visitors were unable to trouble substitute keeper Ian McLoughlin for the rest of what was a fairly drab match.