An exchange of text messages has led to murder charges against two men in a double shooting last December at a Southwest Side home, prosecutors said.

Marco Antonio Solis, 28, was denied bail at his initial court appearance on charges of first-degree murder and attempted first-degree murder in the shooting after being taken into custody Monday in Brighton Park, according to court records.

The alleged triggerman in the shooting, Gerardo Sanchez Amador, was taken into custody in January after he was located in Texas and extradited, Cook County prosecutors said.

Amador, who is also being held without bail, has pleaded not guilty to 40 criminal counts related to the shooting, including murder, attempted murder and home invasion, according to court records.

On Dec. 26, Solis contacted 39-year-old Francisco Mendoza about an ongoing dispute they were having over a drug-related debt and set up a meeting at Mendoza’s Clearing home to discuss the debt and purchase additional narcotics, prosecutors said at a hearing Wednesday.

Solis took Amador along with him, as well as other still uncharged co-offenders, according to prosecutors, who said there was an understanding between the group that if the discussion did not go well, they would kill Mendoza.

From inside the home, Solis allegedly texted a co-offender, “It’s better that we do what we have to do, we are wasting time,” and “shoot ‘em when he puts on the music,” prosecutors said.

Minutes later, Amador pulled out a revolver and shot Mendoza multiple times, then turned the gun on a 23-year-old woman at the house, shooting her in the head, prosecutors said.

The woman was able to call 911 after the group left and identified Amador as the shooter to responding officers, prosecutors said. Mendoza was pronounced dead at the scene, and the woman was taken to a hospital in critical condition. She also later identified Solis from a photo array.

Solis allegedly admitted to being present at the murder two days later when he was questioned, but he told detectives he drove Amador from the scene of the shooting out of fear, prosecutors said. Solis was released from custody, but soon after, detectives recovered the text message.

By that time, Solis had quit his job and moved out of his apartment, prosecutors said. He was taken into custody Monday by a Chicago police tactical unit and placed under arrest.

An assistant public defender for Solis said he had attended high school through his sophomore year in Mexico and has one child.

Judge Arthur Wesley Willis ordered Solis held without bail. Both Solis and Amador are next scheduled to appear in court July 30.