With very little fanfare, the mad bomb collector who kept Brooklyn Heights in a grip of fear over two years ago was quietly sentenced to 18 years in prison.

Prosecutors said that Judge Neil Firetog didn’t deviate from a planned plea arrangement as he sentenced Ivaylo Ivanov during the brief court appearance Thursday, Feb. 25.

Earlier this month, Ivanov, 39, pled guilty to multiple weapons possession and hate crime charges with the understanding that he would be sentenced to 18 years.

He was arrested back in January 2008, after police found an arsenal of pipe bombs and handguns, a sawed off shotgun and a hunting rifle inside his apartment.

Ivanov consented to a search of his home after he showed up at Long Island College Hospital with a gunshot wound to his hand. He claimed that he had shot himself while cleaning one of the guns.

A further investigation revealed that Ivanov had drawn swastikas on the Brooklyn Heights Synagogue and Congregation B’Nai Avraham — both on Remsen Street — as well as several other addresses during a night of hate in the fall of 2007.

The swastika attack happened just after Iranian President Mahmoud Ahmadinejad visited the city, officials said.

Cops charged Ivanov with spray-painting swastikas on several cars, sidewalks and buildings, including the two synagogues. He also papered cars in the neighborhood with flyers containing swastikas and the words “Kill all the Jews.”

After his arrest, Ivanov admitted to scrawling the swastikas, “knowing that said actions would cause annoyance and alarm,” according to a criminal complaint.

Prosecutors said that both vandalized synagogues consented to the plea deal.

A call to the Brooklyn Heights synagogue for comment was not returned.