Threatening letters sent to black guards at the Don Jail prompted a walkout at the east-end facility on Wednesday morning, while another dispute at a west-end jail also triggered job action.
The Ministry of Labour ordered the guards at the Don Jail back to work by mid-afternoon after an agreement was reached to increase security at the detention centre.
Ontario Public Service Employees Union spokesman Don Ford says the back-to-work order gives jail management and union officials three weeks to improve security in and around the jail.
About 30 corrections officers and 20 support staff at the facility walked off the job, saying the province hasn't dealt with what they say are racially motivated hate letters.
The workers say the problem has been ongoing for the past three years, but they chose to walk out on Wednesday because the letters began coming in again after a period where the threats had died down.
The guards say a number of correctional officers have been targeted in anonymous letters that have been found in places in the facility that are only accessible to the guards.
"(They have) f-words, n-words, KKK, it has the famous 'Segregation Now, Segregation Forever,'" said guard and union representative Hayton Morrison.
Workers say the threats are disturbing and they fear for their safety.
"They talk about taking me to a secret location, raping me, torturing me and leaving me to die," said guard Charlene Tardiel. "It's very hurtful. There are times when I cry, there are times when I'm angry."
Corrections officer Rick Cox said he's also been named in some letters.
"I'm shaking, I'm beside myself," he said. "There are no words for this."
A number of white guards also joined their black colleagues during the demonstration in support.
The guards refused to go back to work until the Ontario government addressed their concerns.
Before the walkout ended, Community Safety and Correctional Services Minister Rick Bartolucci promised to take a new look at the complaints.
"'We have to ensure there is an investigation," Bartolucci told reporters. "We have to do everything possible to ensure that those threats, through racism, are not real, and if they are, they're dealt with appropriately."
The job action caused some delays in scheduled criminal trials and routine procedures such as bail hearings at numerous courthouses.
Police have investigated the threatening letters, but so far no charges have been laid. Internal and criminal investigations continue.
Walkout at west-end jail
Meanwhile, Ford said an unrelated labour dispute at the Toronto West Detention Centre, near Pearson Airport, had also been resolved later in the day.
About 80 guards, maintenance and office staff walked off the job on Wednesday morning.
The dispute centres on video cameras used by management to monitor staff, the Toronto Star reported.
Nick Mustari, of the Ontario Public Service Employees Union, said when a staff member recently alleged a sexual assault by a supervisor, management refused to use the video surveillance as evidence.
With a report from CTV Toronto's MairiAnna Bachynsky and files from The Canadian Press