The company that owns the Las Vegas hotel where a gunman opened fire in October 2017, killing 58 people and wounding hundreds more at a music festival outside, said Thursday it had agreed to a settlement that would pay as much as $800 million to victims of the massacre.

The settlement was announced by MGM Resorts International almost exactly two years after what became the deadliest mass shooting in modern U.S. history.

Authorities say the gunman, Stephen Paddock, fired for more than 10 minutes from his 32nd-floor suite at the Mandalay Bay Resort and Casino, taking aim at the crowd gathered for a country music festival far below on the Las Vegas Strip.

The shooting stopped, police said, when Paddock aimed one of his guns at himself and pulled the trigger. Police said the investigation was unable to determine what motivated the carnage.

The settlement agreement is expected to be between $735 million and $800 million, with the final amount depending on how many victims and people affected choose to participate, according to MGM, which owns the Mandalay Bay.

The agreement does not include an admission of liability on the part of MGM, the company said Thursday. MGM also said it has insurance coverage up to $751 million.

The shooting on Oct. 1, 2017, set off lawsuits, including litigation accusing MGM of negligence in failing to monitor the gunman as he delivered guns and ammunition to his room. The settlement process should conclude late next year, the company said, and would also resolve lawsuits MGM has filed against victims, seeking to dismiss claims stemming from the rampage.

“We have always believed that prolonged litigation around these matters is in no one’s best interest,” Jim Murren, chairman and chief executive of MGM Resorts, said in a statement. “It is our sincere hope that this agreement means that scenario will be avoided.”

Mass attacks are frequently followed by a wave of lawsuits, as victims and their relatives take action against the institutions and individuals they argue failed to prevent the violence. But what set the Las Vegas attack apart from the beginning was its stunning scale.

There were 22,000 people at the Route 91 Harvest festival the night of the attack. In addition to the dozens of people who were slain, more than 860 were injured, nearly half by gunshots or shrapnel, authorities said.

Countless more suffered psychological anguish from living through a scene they have described as unimaginably chaotic and terrifying.

Muhammad S. Aziz, an attorney who said he participated in the settlement agreement and is representing more than 1,300 victims and survivors of the attack, said in a statement that it “sends a strong message to the hospitality industry that all steps necessary to prevent mass shootings must be taken.”

Robert Eglet, another attorney for victims, said the agreement was “a milestone in the recovery process for the victims of the horrifying events.”

“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,” Eglet said in a statement released by MGM. He and his firm did not immediately respond to messages seeking further comment.

MGM has said publicly that it was participating in mediation with attorneys for victims who had sued the company over the massacre. In a May filing with the Securities and Exchange Commission, MGM referred to this mediation and said it “intends for substantially all claimants to be covered by the settlement,” though it acknowledged that some may choose not to join.

Last year, MGM filed its own lawsuits against more than 1,000 survivors of the attack, arguing that it had “no liability of any kind” and asking courts to dismiss claims relating to the massacre.

The settlement will resolve those lawsuits as well as all others that the company knows about, John McManus, MGM’s general counsel, said in a telephone interview Thursday.

McManus said the company’s long-standing desire was to settle all litigation.

“The notion that we’d be embroiled in disputes with victims we wish nothing but the best for, for a number of years, that is not a path that was appealing to us in any way,” McManus said.

He said the company hopes “this settlement provides meaningful and fair compensation to the people that are most impacted” and helps the community in its recovery.

“It’s a horrible, unspeakable tragedy, and it can’t be undone,” McManus said. “And unfortunately the person who is responsible, there’s no way to bring that person to justice. All we can do is move forward.”