A man wanted for the murders of a prominent forensic psychiatrist and five other people in Arizona killed himself Monday as police were closing in, authorities said.

Dwight Lamon Jones, 56, shot himself in his hotel room after firing at officers who descended on the Extended Stay hotel in the Phoenix suburb of Scottsdale, Assistant Police Chief Rich Slavin told reporters on Monday afternoon.

"Others would have been harmed if this had not come to a conclusion," added Maricopa County Sheriff Paul Penzone.

Dwight Lamon Jones Maricopa County Sheriff's Office

Slavin said that conclusion came after a marathon effort that involved multiple law enforcement agencies piecing together hundreds of tips and evidence from eyewitness, surveillance, ballistics, DNA and YouTube videos.

Though Jones' motive in the killings wasn't clear, Slavin said, it appeared that a bitter, nearly decade-old divorce was connected to them — along with an effort "to right some wrongs."

The authorities' hunt for Jones began on Thursday, after 59-year-old forensic psychiatrist Steven Pitt, who advised police and prosecutors in high-profile cases like the JonBenét Ramsey murder and the Columbine school massacre, was shot dead outside his Phoenix office.

Pitt also conducted a court-ordered psychiatric evaluation of Jones during his divorce, sources told NBC News.

Witnesses who reported hearing a loud argument and then gunshots provided police a description of the gunman that allowed them to create a sketch.

Sketch of man who killed Steven Pitt. Phoenix Police Department

Then on Friday, paralegals Veleria Sharp, 48, and Laura Anderson, 49, were killed inside a law office in Scottsdale, and police were able to link their deaths to the Pitt killing.

Both women worked for Elizabeth Feldman, who court records show was the divorce lawyer for Jones' ex-wife, Connie Jones.

On Monday, Slavin said he believed that Dwight Jones had visited the office to kill Feldman.

A fourth shooting victim, Marshall Levine, 72, was discovered dead in his Scottsdale office early Saturday morning by his girlfriend, Slavin said.

Levine wasn't connected to the divorce, Slavin said, though his office was. It belonged to a psychiatrist who evaluated Jones' son during the divorce proceedings but was subletting it to Levine.

Authorities also believe that Jones killed an unidentified man and woman in the Phoenix suburb of Fountain Hills, Slavin said.

Investigators connected Jones to their deaths after police covertly watched him throw a .22-caliber pistol that belonged to the man in a trash can, Slavin said.

At the time, authorities were still developing evidence that Jones was a suspect in the other killings, so investigators watched him, Slavin said, adding that this surveillance didn't begin until after the man and woman were killed.

It wasn't yet clear what their relationship was to Jones.

"We don’t have the same kind of linkage that we have with the other scenes," Slavin said.

Nor could Slavin say what may have prompted Jones to target people involved in his divorce now.

Court records obtained by the NBC affiliate in Phoenix show that Connie Jones — a radiologist at a mammography center now married to a former Phoenix police detective — filed for divorce in 2009 and the case was not settled until 2017 because of disputes over alimony and child custody.

At one point, she sought an order of protection from her husband, who acted as his own attorney in the divorce, records show.

Shortly before Connie Jones filed for divorce, Dwight Jones was charged in May 2009 with misdemeanor assault, threats and intimidation, and disorderly conduct. He later pleaded guilty to disorderly conduct, the affiliate reported.

In a statement Monday, Connie Jones said she was saddened "by the tragedy caused by my ex-husband," whom she described as "a very emotionally disturbed person."

"I have feared for my safety for the past nine years," she said. "I cannot express the emotions I feel for the innocent families touched by his senseless violence."

Jones added that her husband, Richard Anglin, tipped off Phoenix police to her ex-husband on Saturday night after recognizing the connections between Connie's divorce and the three crime scenes.