Bulgaria coach quits after Montenegro loss
"I wanted the team to get to the finals but it's obvious that after two defeats, one at home, it's going to be very difficult," Stoilov told reporters.
"I've already informed the team and Bulgarian Football Union president (Borislav Mihaylov) of my decision."
Bulgaria also lost 4-0 to England on Friday.
"I accepted Stoilov's resignation and we begin our search for a new coach tomorrow," said Mihaylov.
Stoilov took over from Plamen Markov in February 2009.
Elsad Zverotic scored Montenegro's winner when he unleashed a thunderous shot from outside the penalty area after 35 minutes to notch his first international goal.
Montenegro, who also beat Wales 1-0 on Friday, have won their opening two qualifying games.
Bulgaria are ranked 43rd by FIFA while Montenegro are down at number 73.