A man fatally shot his girlfriend’s secret lover before turning the gun on himself after he walked in on the cheating couple Wednesday morning in Brooklyn, police said.

The jilted boyfriend, 27, went to his girlfriend’s home on Dean Street in Brownsville around 9:45 a.m. and caught her in bed with another man, sources said.

He whipped out a gun and blasted his girlfriend’s 24-year-old paramour in the chest, sources said, and then took his own life by shooting himself in the head.

EMS responded and pronounced both men dead at the scene. The woman was not hurt.

The mother of one of the victims rushed to the scene, but cops wouldn’t let her enter the building. “My son is gone and I can’t go up?” she wailed.

The violence followed a report in Monday’s Post that shootings, murders and the number of shooting victims in the city have all spiked this year compared to the same period in 2014.