The governmental entity that filed a civil action or intervened is entitled to reasonable costs and attorney fees if the action is settled favorably for the governmental entity or the governmental entity prevails. In an action in which outside counsel is engaged by a government attorney, the costs and attorney fees awarded to that counsel must equal the outside counsel's charges reasonably incurred for costs and attorney fees in prosecuting the action. In any other actions in which costs and attorney fees are awarded to the governmental entity, they must be calculated by reference to the hourly rate charged by the department of justice agency legal services bureau for the provision of legal services to state agencies, multiplied by the number of attorney hours devoted to the prosecution of the action, plus the actual cost of any expenses reasonably incurred in the prosecution of the action. A person who is a plaintiff or coplaintiff is entitled to reasonable expenses that the court finds to have been necessarily incurred, plus reasonable costs and attorney fees, if the action is settled favorably for the governmental entity or the governmental entity prevails in the action. A defendant in a civil action brought pursuant to this part who prevails in an action that is not settled and that the court finds was clearly frivolous or brought solely for harassment purposes is entitled to the defendant's reasonable costs and attorney fees. If the governmental entity does not intervene, it is not responsible for any of the defendant's fees and costs.
§ 17-8-411, MCA