San Francisco Superior Court Judge Garrett Wong modified the stay-away order to allow Mirkarimi, 50, to stay at the family's Webster Street home until April 27, a day before his wife and son are scheduled to return from a trip to Venezuela.
The order had barred Mirkarimi from entering the home since he was arrested and charged in January in connection with a domestic violence incident involving his wife, Eliana Lopez.
Mirkarimi eventually pleaded guilty last month to a misdemeanor false imprisonment charge in connection with the incident, in which he grabbed Lopez's arm during an argument on Dec. 31. He was sentenced a week later to three years' probation and other penalties.
On March 21, Mayor Ed Lee suspended the sheriff without pay on official misconduct charges. Mirkarimi is currently awaiting a hearing by the city's Ethics Commission on the charges and has also filed a petition for a writ in court to overturn the suspension.
A judge on March 23 altered the stay-away order against Mirkarimi to grant Lopez permission to go with her son Theo to Venezuela for five weeks to visit her ailing father. The order had previously been modified in February when Mirkarimi was granted visitation rights with Theo.
Mirkarimi, who has been staying with former Mayor Art Agnos and other friends, appeared at the Hall of Justice today for a hearing on the modification request to allow him to stay at the family's home.
Prosecutors did not object to the judge's ruling, district attorney's office spokeswoman Stephanie Ong Stillman said.
Mirkarimi is scheduled to return to court on Friday morning to show proof that he has enrolled in a domestic violence counseling program.