Customers at an East Village Starbucks escaped a shot of shattered glass in their lattes when the cafe windows withstood an anarchist onslaught.



Patrons at Astor Place coffee shop dashed underneath tables as metal pipe-wielding protesters attempted to shatter its floor-to-ceiling Plexiglas windows during a Saturday night riot, police and workers said.



Luckily, the unbreakable panes prevented injuries, one barista said.



“It was scary, we didn’t know what was happening,” she said. “There were a lot of them with bats and wearing masks.”



The frightened woman and her coworkers scurried to lock the door, she said. “No one got hurt in here and that’s all that matters.”



But two NYPD officers weren’t so fortunate. A sergeant was hit repeatedly in the head, body and hands with a metal pipe, a police source said, while a lieutenant also sustained injuries.



Nicholas Thommen, 30, and Eric Marchese, 24, were arrested outside Starbucks, and Occupy Wall St. attorney Alexander Penley, 41, was arrested later outside an E. Sixth St. community center, where clashes with police continued.



Penley, 41, of West End Avenue, and Thommen, 30, of Salem, Ore., were both charged with second-degree assault, criminal possession of a weapon, menacing, resisting arrest, inciting to riot, disorderly conduct and obstructing governmental administration, police said.



Marchese, 24, of Brentwood, L.I., was charged with criminal mischief and disorderly conduct.



The three were part of a group of 25 people - some of them masked - carrying 8-feet-long galvanized metal pipes, using them to vandalize commercial properties, cops said.



The group carried on and marched against traffic into the streets near Washington Square Park after leaving the Fifth Annual New York City Anarchist Book Fair at Judson Church on Washington Square South, police said. They began chanting “F--- the NYPD”, “All pigs must die,” and “Cops are murderers’, officials said.



A larger group of around 150 people spray painted anarchist symbols on commercial property and tossed garbage cans while throwing pipes and bottles at responding officers, according to police.



“This is something we don’t have anything to do with, we are a book fair,” said event organizer Wayne Price. “Different publishers put of their books, there are workshops and discussions. We did not organize the demonstration,” he said.



sarmaghan@nydailynews.com