Australia started the morning session on 174-6 as they chased a target of 311 runs, and they steadily added 33 to their overnight score before Ashton Agar was caught in the slips by Alastair Cook following an Anderson delivery.
The combination of Anderson and Cook struck again soon after as Mitchell Starc was dismissed for one to ease the nerves of the home fans.
Australia were given a reprieve when Peter Siddle was dropped by Cook, but the England captain made no mistake a second time as he caught the batsman off Anderson for 11.
However, Haddin and James Pattinson both dug in at the crease to gradually whittle the runs down as the Trent Bridge crowd grew increasingly tense.
Both sides went in for lunch with Australia needing 20 runs for the victory with one wicket in hand before Anderson took out Haddin (71) thanks to a review in the third over after the break.