"I managed to get a wee break," Cooper said. "I knew I needed a break there to hold Dirk off. He was amazingly strong today and all I could do was sit on and wait for my opportunity on that final lap.
"I fell about 25 seconds before the finish, which got the heart-rate going. It was pretty nerve-wracking but I managed to get up and hold on. If he had got in front, then he would have won.
"It is such a great feeling to win the national jersey. It means I will be able to wear it overseas at the World Cups and that is of huge importance to me and I will wear it with great pride."
Peters, who will head to Europe again this year, was buoyed by his strong form following on from on last week's mountain bike cup.
"I knew it was going to be pretty close," he said. "I think he probably had the edge on me but, with the hometown advantage, I got lifted that extra couple of per cent and nearly got there.
"I kept throwing in attack after attack but couldn't drop him and he got ahead before the final downhill. It was so narrow I couldn't get past when he crashed and it came down to that last sprint.
"It is good to have a yard-stick with Anton. We know he is world-class so we can match ourselves against him. It gives me an good indication of where I am at compared with other riders overseas and good for my confidence to know that I can be competitive in Europe, hopefully."
Hanlen, the Whakatane mother of two, fell behind Queenstown's Kate Flucker after her fall on lap two but the Olympian then turned it up a notch to reclaim the lead and push clear. She won in 1:34.26 for the six laps, with Flucker second nearly three minutes behind.
Wellington's Samara Sheppard, in her first year in the elite category, was third a further three minutes back.
"I am really pleased," Hanlen said. "It is a special privilege to win the national title. I had to work hard for it. I was pushed really hard in those first two laps before I managed to get a break. It is good to see another really good rider in Kate coming on strongly."
It was also a special day for former national champion and Commonwealth Games representative Mike Northcott (Tokoroa), who finished fifth overall before announcing his retirement from elite racing after 16 years at the top level.
Rotorua's Amber Johnson and Te Awamutu's Sam Gaze both produced outstanding efforts to win the under-19 titles.
The championships conclude tomorrow with the downhill championships.