LAS VEGAS -- Two years after a shooter rained gunfire on country music fans from a high-rise Las Vegas hotel, MGM Resorts International reached a settlement that could pay up to $800 million to families of the 58 people who died and hundreds of others who were injured, attorneys announced Thursday.

It will resolve hundreds of lawsuits in multiple states that seek compensation for a range of physical and psychological injuries from the deadliest mass shooting in modern U.S. history and comes just two days after the second anniversary of the Oct. 1, 2017, massacre.

Victims say the casino giant failed to protect 22,000 people at a concert venue it owns or stop the shooter from spending several days amassing an arsenal of assault-style weapons and ammunition in his suite at the Mandalay Bay resort.

The settlement creates the third-largest victims compensation fund in U.S. history, according to a claims administrator who has doled out money in major attacks and disasters. Kenneth Feinberg, who wasn't involved in the Las Vegas deal, said he oversaw $7.1 billion in victim compensation after the Sept. 11, 2001, terrorist attacks and $6.5 billion following the 2010 BP oil spill in the Gulf of Mexico.

The amount of the settlement with MGM depends on the number of plaintiffs who take part, according to a statement from Las Vegas law firm Eglet Adams, which represents nearly 2,500 victims.

"Our goal has always been to resolve these matters so our community and the victims and their families can move forward in the healing process," said Jim Murren, chairman and CEO of MGM Resorts. "This agreement with the plaintiffs' counsel is a major step, and one that we hoped for a long time would be possible."

Robert Eglet, a lead plaintiffs' counsel, said in the statement that the deal "represents good corporate citizenship" by MGM Resorts.

"Today's agreement marks a milestone in the recovery process for the victims of the horrifying events of 1 October," Eglet said. "While nothing will be able to bring back the lives lost or undo the horrors so many suffered on that day, this settlement will provide fair compensation for thousands of victims and their families."

Attorneys for victims are planning news conferences Thursday in Las Vegas and San Diego.