OPSEU Local 108 and the Ministry of Correctional Services have reached a deal to end a six-day lockdown and work refusal at the Elgin-Middlesex Detention Centre.

Under the terms of the agreement, all units will be searched before a lockdown at the facility is lifted, which is expected to take a few days. Correctional officers will then return to their posts.

The union had been calling for the search, after makeshift weapons were found in the women's area of the jail after a weekend of riot-like conditions.

The two sides had failed to come to an agreement after 12 hours of negotiations on Monday, but Tuesday union officials met directly with the minister and were finally able to get the province to agree to the demand for a search.

Dominic Bragaglia, president of OPSEU Local 108, says, "It's incredible we had to get to this point just to do a search of the building because those things are normal for corrections, but unfortunately it had to go all the way to the minister's office."

The facility was locked down last week after five correctional officers and one manager were dismissed in connection with the death of inmate Adam Kargus October.

That's when correctional officers engaged in a series of work refusals. The trouble peaked Saturday when female inmates rioted, flooding their unit and breaking apart their lights - parts of which were found made into weapons on Sunday.

The situation has galvanized correctional officers across the province, with at least eight institutions in various states of lockdowns and work refusals over so-called standing orders.

Standing orders are unique to each institution and are the rules correctional officers must follow on the job. They are supposed to be reviewed annually, but many haven't been updated in a decade.

The main concern is that officers are often forced to break rules to get their jobs done and don't have rules to deal with some issues faced on a daily basis.

Bragaglia says "We've got to have clear direction and clear rules, so we know what we're doing, when we're doing it and how we're doing it...A lot of things have to be overhauled, a lot of things have to be modernized, a lot of things have to be done to bring them up to speed to what's really going on in 2014."

The province is promising to review all standing orders at all Ontario jails, thought that is likely to be a long-term project.

Statement from Minister of Community Safety and Correctional Services Yasir Naqvi

"The safety and security of our correctional staff and inmates has been our top priority throughout this process.

"We had a productive meeting with local and provincial OPSEU representatives this morning. We share the same goal of resuming regular operations as quickly as possible in a way that ensures the safety and security of our both correctional staff and inmates.

"I am pleased that working together, we are moving forward on a plan to do that while continuing discussions on other areas to further improve the safety, training and supports for correctional staff and inmates.

"Working together we have made a number of improvements at EMDC over the past two years including 350 new security cameras, additional metal detectors, a baggage x-ray machine and new meal hatches and cell door locks.

"We have also hired 11 additional full-time correctional officers, a mental health nurse, implemented 24-hour nursing and created a dedicated team of correctional officers to provide community escorts.

"I want to thank the managers who have made many sacrifices during this process to ensure the safety of inmates and the people of Ontario.

"We value the work of all of our correctional service staff, including our correctional officers, and the contribution they make to keeping Ontario safe. We will continue working with our correctional officers to ensure the safety of inmates and staff and that all the proper training and supports are in place.”