Both clubs are in the hunt for the Swedish title and are separated by just four points in the standings.
The match proved just as close, with Hammarby sealing a 2-2 draw with a second-half equaliser.
Former Celtic and Stoke player John Guidetti opened the scoring for AIK in the second minute. Nahir Besara then equalised just a few minutes before the interval.
AIK took the lead through Nicolas Stefanelli, though the hosts failed to hang on to their slender advantage as Veton Berisha secured a point for Hammarby.
Despite an entertaining clash in the Allsvenskan, it was the post-match scenes which tarnished a great spectacle.
A full-on brawl broke out in parts of the Friends Arena, with pyrotechnics also thrown in both directions.
AIK's club director Manuel Lindberg told Sport Bladet: "It is very sad for Swedish football, I think. It is completely unacceptable and we will of course investigate what has happened together with the police."
Goalscorer Guidetti also condemned the violent scenes, saying: "There are a lot of families with children here, my children among them, and it's not something I want them to see clearly.
"Everyone thinks it's really sad when it was such a wonderful setting and our supporters have been absolutely fantastic. But unfortunately it happened today and we hope it won't happen again."