With the prospect of spending the rest of his life in prison, a 31-year-old man has pleaded guilty to being one of three masked men who invaded a north Minneapolis home late at night and raped a woman and her teenage daughter while beating them and demanding money during a violent 90 minutes of horror.

By admitting to two counts of first-degree criminal sexual conduct and burglary, Roynell Taylor and the prosecution has agreed to a 30-year term when he is sentenced Aug. 19 in Hennepin County District Court in connection with the ambush on July 19, 2015.

Grand jury indictments in February returned numerous counts against Taylor and the two others that could have led to life prison terms if convicted.

Also charged are Deondre L. Bishop, 31; Reggie D.P. Bishop, 32. They have hearings in their continuing cases scheduled for Aug. 8. Authorities have not disclosed how the two are related. All three remained jailed.

Prosecutors say the terror unfolded when the woman’s 14-year-old daughter was ambushed in the kitchen at gunpoint by one of the men about 11 p.m. All three men took her upstairs, where her mother was sleeping.

The men tied both victims’ arms behind their backs, put pillowcases over their heads and demanded to know where “the money was,” the criminal complaints against the defendants read.

After the men ransacked the house, one of them took the teenager upstairs to her bed and raped her. The mother had a gun put to her head and was sexually assaulted by two of the men, the complaint said.

The men left with televisions, a laptop and a cellphone. The mother called police.

The woman recognized one of the attackers, the complaint said, and police also relied on other evidence, including DNA on a lemonade bottle and information from a cabdriver, to identify suspects. The woman’s cellphone was found on one of the suspects.

All three defendants have lengthy criminal histories in Minnesota.