'Attica! Attica!' Pacino's 'Dog Day Afternoon' Line, Explained

Source: IMDB

Even if you haven’t watched Dog Day Afternoon, one of the most intense and tragicomic films of the 1970s, you’ve heard the phrase “Attica! Attica!” Al Pacino, playing a bank robber, shouts this mysterious word again and again during a standoff with the NYPD, and it riles up the crowd. Attica is a town in western New York state, far away from Brooklyn, where Dog Day Afternoon is set. According to the people involved with the film, things were free flowing on set which allowed for all kinds of improvisations and discoveries, leading a to film that was like no other in 1975, and a scene that will outlast the film from which it was born.

"Attica" wasn't in the script, and neither Pacino nor director Sidney Lumet came up with it. So why is it there in the moviee, and what does it mean?