MODERN FAMILY beauty SOFIA VERGARA is having second thoughts about starting a family with wealthy fiance Nick Loeb – because his family has a tragic history of murder and madness!

The ENQUIRER learned that Loeb’s mentally ill mom gunned down her third hubby before taking her own life in March 1996.

Needless to say, Sofia doesn’t blame Nick for his mother’s gruesome actions,” said a source close to the 41-year-old Holly­wood sexpot.

“But does she want to run the risk that their baby could inherit a predisposition toward violence?”

According to police reports, Loeb’s mother, socialite Meta Harrsen Bauer, pumped three bullets into her estranged husband, publisher Jeffrey L. Bauer, at his small-town New Jersey newspaper, the “Westfield Leader.” Then Bauer, 46, placed the .357 Magnum into her own mouth and pulled the trigger. Along with her gun, she was carrying a suicide note, police said.

She’d traveled by train from her home in Durham, N.C., to carry out the planned murder-suicide. Police found a wig, binocu­lars and more ammunition in her rental car at the Westfield train station.

Sofia has also been touched by family tragedy. Her older brother, Rafael Vergara, was gunned down in August 1996 at the age of 26 in their native Colombia.

The brunette beauty has been engaged to Nick, heir to a banking fortune, since July 2012, and has revealed she’s frozen her eggs.

“Sofia wanted to have a child with Nick,” said the source. “But knowing his mom was a murderer, she may have a change of heart.”

Her grown son, Manolo, 21, is glad. As The ENQUIRER has reported, he dislikes hotheaded Nick intensely and begged Mom to put the brakes on the relationship.