New Jersey State Police received 958 reports of data breaches in 2017, a 42 percent increase from the year before, authorities announced Tuesday.

The breaches affected 4.38 million accounts belonging to New Jersey residents, with the vast majority coming from last year's Equifax data breach, which affected more than 4 million residents, according to the attorney general's office.

In 2016, there were 676 reported breaches affecting roughly 116,000 New Jersey account holders.

The attorney general's office said it oversaw data privacy investigations that resulted in $4.8 million in civil settlements with the state in 2017.

Data breaches can involve identity theft or unauthorized access to personal health information, trade secrets or intellectual property. The figures released Tuesday only include incidents that were required by law to be reported to state police, authorities said.

To avoid a data breach, consumers should avoid opening links and attachments emailed from unknown senders, use strong passwords and two-factor authentication, adjust privacy settings to control data sharing, install security software on devices and avoid free Wi-Fi, especially when conducting personal transactions, according to the Division of Consumer Affairs.