PORTLAND, Maine — Two maximum security inmates who rigged locks and eluded guards long enough to meet up for a sexual encounter Saturday tried their cell escape acts the previous night and failed, according to Cumberland County Chief Deputy Naldo Gagnon.

Gagnon told the Bangor Daily News Tuesday that when a corrections officer discovered inmate Arien L’Italien, 23, crawling across the floor to get back to his cell, it represented the second time in two nights L’Italien had tried to break out of his cell for sex. Now, Gagnon said, Cumberland County Sheriff’s Office and jail officials have implemented measures intended to insure the breach was the last of its kind.

The chief deputy said investigators learned of the previous attempt while questioning L’Italien and Karla Wilson, 25, about their rendezvous, and the inmates told them they had been unable to successfully manipulate the locks on their cell doors the first time around.

The second time around, Gagnon said, the inmates were able to rig their locks so they did not close all the way, and L’Italien reopened his door after being checked in for the night. He made up his bunk to make it appear as though he was in it, and snuck from his cell in the men’s cellblock to Wilson’s cell in the women’s cellblock on the same level of the maximum security unit. There, the sheriff’s department believes, the two engaged in consensual sex.

The inmates coordinated their tryst by communicating through the ventilation system, according to a sheriff’s office news release, and carried out their plans between 11:50 p.m. Friday and 12:50 a.m. Saturday morning, when L’Italien was spotted crawling back to his cell.

L’Italien is a federal inmate being held on a probation violation, and is awaiting trial on attempted murder charges for his role in a high-profile shootout with U.S. Marshals on Mellen Street in January. Wilson is awaiting trial on four counts of gross sexual assault and two counts of aggravated assault resulting from the alleged rape of a 24-year-old Portland woman in a Park Avenue apartment last August.

“If he wants to play games, he can go up there where life is not so rosy,” said Cumberland County Sheriff Kevin Joyce.

Gagnon said jail officials believe the Saturday night meet-up was the first time inmates in the maximum security unit have been able to get out of their cells during a period when they were supposed to be locked in, and that “they needed a lot of luck” to get away with it as long as they did. He said that while L’Italien and Wilson were able to manipulate their cell door locks, they were not in positions to escape the jail to freedom.

In the aftermath of the incident, Gagnon said county officials have taken steps to prevent future similar occurrences.

“We’ve made some simplistic changes to where this will never happen again,” Gagnon said.

The desks where officers are located in the pods are now repositioned to better see where L’Italien was caught crawling, and the cell door locks are being regularly physically checked to make sure they’re latched. Previously guards checked them visually, he said.

Further, he said, the four security doors in the walkway through which L’Italien snuck to get from his cellblock to Wilson’s will be locked overnight. Gagnon said the jail’s prior procedure was to lock the doors during the daytime hours, when inmates were allowed out of their cells into a common area, and leave them unlocked at night, when inmates were presumed to be locked in their individual cells.