The department at any time after a complaint is filed with it and it has been determined that probable cause exists for believing that the allegations of the complaint are true and constitute a violation of this part, may bring an action in the superior court to enjoin the owner of the property from taking further action with respect to the rental, lease, or sale of the property, as well as to require compliance with Section 12956, until the department has completed its investigation and made its determination; but a temporary restraining order obtained under this section shall not, in any event, be in effect for more than 20 days. In this action an order or judgment may be entered awarding the temporary restraining order or the preliminary or final injunction in
accordance with Section 527 of the Code of Civil Procedure. In civil actions brought under this section, the court, in its discretion, may award to the department reasonable attorney’s fees and costs, including expert witness fees, when it is the prevailing party for the purposes of the order granting temporary or preliminary relief.