A group of fans kicked and punched Bajevic during a pre-season friendly on August 8 and a section of the crowd threw seats towards him after Sunday's defeat, although none hit him.
It was the 61-year-old Serbian's third stint in charge of the club, but a group of the fans are apparently enraged by his previous job coaching rivals Olympiakos.
He told reporters at a post match news conference: "I will not be talking about the game, what I can say is that I have informed the president and the players that I have resigned."
AEK have experienced a disappointing start to the new season and the Yellows are languishing 13th in the 16-team Super League after picking up just four points from four matches.
Thank you for reading 5 articles this month* Join now for unlimited access
Enjoy your first month for just £1 / $1 / €1
*Read 5 free articles per month without a subscription
Join now for unlimited access
Try first month for just £1 / $1 / €1