An armed man stormed a New Year's Eve party in Brazil, fatally shooting his estranged wife and 11 other relatives before taking his own life, local media reported.

The shooting took place shortly before midnight in the town of Campinas, about 100kms north of Sao Paulo, according to news reports that cited local police.

The 12 shooting victims, all members of the same family, had gathered to ring in the new year.

Reports said the estranged couple had recently separated. The dead included their eight-year-old son.