Judge Robert Wolf also ruled Tuesday that he would not order more hair-removal treatments for Michelle Kosilek.
Despite the ruling, Wolf says state correction officials must continue to make arrangements for the surgery.
Lawyer Fran Cohen, who represents Kosilek, says her client appreciates that stipulation.
"We feel pleased that the court has asked the Department of Correction to take this seriously and specifically has told the department that he will use the contempt power to force their compliance," Cohen said.
Kosilek, convicted in the 1990 murder of wife Cheryl Kosilek, was born male but has received hormone treatments and now lives as a woman in an all-male prison.
Wolf said Tuesday that additional electrolysis for Michelle Kosilek would have to be part of a new case.
The state Department of Correction has said it discontinued electrolysis treatments after finding Kosilek had already received significant hair removal and her remaining hair could be removed by shaving or depilatories.
With reporting by The Associated Press and the WBUR Newsroom.
This program aired on November 20, 2012. The audio for this program is not available.