
113 Cal.Rptr.2d 271 (2001)
93 Cal.App.4th 518
The PEOPLE, Plaintiff and Respondent,
v.
Jose RUGAMAS, Defendant and Appellant.
No. C035576.
Court of Appeal, Third District.
October 31, 2001.
Roeser & Roeser and Michael J. Roeser, Zephyr Cove, NV, for Defendant and Appellant.
Bill Lockyer, Attorney General, David P. Druliner, Chief Assistant Attorney General, Robert R. Anderson, Senior Assistant Attorney General, Clayton S. Tanaka, Acting Supervising Deputy Attorney General, Alan Ashby, Deputy Attorney General, for Plaintiff and Respondent.
RAYE, J.
Defendant Jose Rugamas pled no contest to brandishing a deadly weapon to avoid arrest, a felony (Pen.Code, § 417.8).[1]*272 Defendant contends the trial court improperly imposed $6,601.42 in restitution to the police department for medical bills incurred after an officer shot him with rubber bullets. We affirm.

BACKGROUND
On August 23, 1998, defendant's wife called police to report a domestic disturbance. When officers arrived, defendant was in his front yard, intoxicated and holding a machete. Defendant refused to drop the machete despite the officers' repeated requests. Defendant paced back and forth, 10 to 30 feet from the officers, and told the police they would have to shoot him.
The officers were able to get defendant's wife and children out of the house. Defendant continued to pace back and forth. Approximately 20]minutes after the officers arrived, defendant walked back toward the house. The officers warned defendant not to go inside, but defendant said he was going to. Concerned that there might be other people in the house or that defendant might have other weapons inside, and to avoid a barricade situation, one of the officers shot defendant five times with rubber bullets.
Although rubber bullets are nonlethal, defendant was hospitalized for injuries sustained when he was shot. His hospital bills totaled $6,601.42 and were billed to and paid by the South Lake Tahoe Police Department.
Defendant was charged with brandishing a deadly weapon to avoid arrest, a felony (§ 417.8), and misdemeanor corporal injury to a spouse (§ 273.5, subd. (a)). He pled no contest to the section 417.8 felony violation and was sentenced to three years' formal probation. He was also required to serve 30 days in county jail, continue with family and anger management counseling, and attend alcohol counseling to address what he admitted to be the root of his problem. Over defense counsel's objection, defendant was also ordered to pay $6,601.42 in restitution to the police department.

DISCUSSION
Defendant argues that the restitution order is not appropriate under the direct victim restitution statute, section 1202.4. Restitution was not, however, imposed under section 1202.4 but under section 1203.1. The prosecution based its argument for restitution on the power of the court to order nonstatutory restitution, and the trial court referenced section 1203.1 in its ruling imposing the fine.[2]
As the trial court correctly noted, section 1203.1 provides a court granting probation with broad discretion to impose conditions it hopes will foster rehabilitation and protect public safety. (§ 1203.1, subd. (j); People v. Carbajal, supra, 10 Cal.4th at pp. 1120-1121, 1126, 43 Cal.Rptr.2d 681, 899 P.2d 67 (Carbajal).) "The court may impose and require ... [such] reasonable conditions ... as it may determine are fitting and proper to the end that justice *273 may be done, that amends may be made to society for the breach of the law, for any injury done to any person resulting from that breach, and generally and specifically for the reformation and rehabilitation of the probationer ...."(§ 1203.1, subd. (j).)
"A probation condition is valid as long as it relates to the crime for which the defendant is convicted, relates to other criminal conduct, or requires or forbids conduct which is reasonably related to future criminality." (People v. Correll (1991) 229 Cal.App.3d 656, 660, 280 Cal.Rptr. 266.) "Restitution has long been considered a valid condition of probation." (Carbajal, supra, 10 Cal.4th at p. 1121, 43 Cal.Rptr.2d 681, 899 P.2d 67.) "A reviewing court may not invalidate any condition of probation, including restitution, unless the condition `(1) has no relationship to the crime of which the offender was convicted, (2) relates to conduct which is not in itself criminal, and (3) requires or forbids conduct which is not reasonably related to future criminality....'" (People v. Goulart (1990) 224 Cal.App.3d 71, 78, 273 Cal. Rptr. 477 (Goulart), citing People v. Dominguez (1967) 256 Cal.App.2d 623, 627, 64 Cal.Rptr. 290.)
"While restitution serves the obvious function of compensating crime victims, its primary goal is the rehabilitation of the criminal." (Goulart, supra, 224 Cal. App.3d at p. 78, 273 Cal.Rptr. 477.) "Implicit in the concept of rehabilitation is the need to first deter criminal activity. Courts have generally found an order requiring the defendant to compensate the victim to be a deterrent to future criminal activity." (Id. at p. 78, fn. 4, 273 Cal.Rptr. 477.) "Restitution `is an effective rehabilitative penalty because it forces the defendant to confront, in concrete terms, the harm his actions have caused. Such a penalty will affect the defendant differently than a traditional fine, paid to the State as an abstract and impersonal entity, and often calculated without regard to the harm the defendant has caused. Similarly, the direct relation between the harm and the punishment gives restitution a more precise deterrent effect than a traditional fine.' [Citations.]" (People v. Moser (1996) 50 Cal.App.4th 130, 135-136, 57 Cal. Rptr.2d 647 (Moser).)
The restitution condition here is reasonably related to both the crime of which defendant was convicted and the goal of deterring future criminality. (See Carbajal, supra, 10 Cal.4th at pp. 1123 1124, 43 Cal.Rptr.2d 681, 899 P.2d 67.) It is readily apparent the trial court considered the rehabilitative aspects of the restitution imposed. It specifically explained it felt the restitution would "result in the defendant accepting responsibility for his conduct and hopefully ... deter further attempts by the defendant from disobeying lawful police orders."
Defendant contends the restitution order is unauthorized because the hospital bills were not reasonably related to the crime of which defendant was convicted but instead were due to the officer's decision to carry out his duties in the manner in which he did. We fail to see a distinction. The officer would not have had to carry out those duties absent defendant's criminal behavior. Defendant's injuries (and the resulting hospital bills) flow directly from defendant's criminal conduct of brandishing a deadly weapon at the police officers. This is precisely the conduct for which defendant was convicted. (See People v. Richards (1976) 17 Cal.3d 614, 619, 131 Cal.Rptr. 537, 552 P.2d 97, disapproved on another point in Carbajal, supra, 10 Cal.4th at p. 1126, 43 Cal.Rptr.2d 681, 899 P.2d 67.) The direct relation between the harm defendant caused and his punishment furthers the deterrence goal of restitution and forces him to confront, *274 in concrete terms, the harm his actions have caused. (Moser, supra, 50 Cal. App.4th at pp. 135-136, 57 Cal.Rptr.2d 647.) Thus, the restitution order serves a valid purpose pursuant to section 1203.1.
Defendant next argues that, under People v. Torres (1997) 59 Cal.App.4th 1, 68 Cal.Rptr.2d 644 (Torres), the police department is not an appropriate recipient of restitution. We find defendant's authority inapplicable to the instant case. Torres held that government entities were not entitled to receive mandatory victim restitution under section 1202.4 for costs associated with the standard performance of their duties, such as money used for drug stings or for the criminal prosecution of the defendant. (Torres, supra, 59 Cal. App.4th at pp. 4-5, 68 Cal.Rptr.2d 644.) Unlike Torres, which involved application of section 1202.4's mandatory restitution for "direct victims," restitution in the instant case was ordered pursuant to the general probationary conditions permissible under section 1203.1.
Further, Torres concerned restitution for overhead expenses incurred in the course of the regular investigatory duties of the sheriffs department. (Torres, supra, 59 Cal.App.4th at pp. 4-5, 68 Cal. Rptr.2d 644.) The government may be the beneficiary of restitution under section 1203.1 if it has incurred actual loss due to the crime, excluding those general costs of prosecuting and rehabilitating criminals. (People v. Baker (1974) 39 Cal.App.3d 550, 559, 113 Cal.Rptr. 248.) The South Lake Tahoe Police department was not provided restitution for expenses associated with the cost of performing its regular duties such as the weapons or rubber bullets used, the gasoline for the squad cars, or the salaries of the officers involved. Instead, it was reimbursed for its out-of-pocket loss resulting from unusual expenses directly incurred because of defendant's conduct.
As the hospital bills are reasonably related to defendant's crime and were imposed the restitution of $6,601.42 is authorized under section 1203.1.

DISPOSITION
The judgment is affirmed.
We concur: SCOTLAND, P.J., and CALLAHAN, J.
NOTES
[1]  All further statuory references are to the Penal Code.
[2]  The court explained its ruling on defendant's motion to modify probation as follows: "Courts have broad discretion to impose restrictive conditions to foster rehabilitation and to protect public safety. Under Penal Code Section 1203.1, courts may impose any reasonable conditions necessary to secure justice, make amends to society and assist the reformation and rehabilitation of the probadoner. (See People v. Carbajal [(1995)] 10 Cal.4th 1114, 43 Cal.Rptr.2d 681, 899 P.2d 67.)[¶] This Court feels that by requiring the defendant to pay the restitution it will result in the defendant accepting responsibility for his conduct and hopefully will deter further attempts by the defendant from disobeying lawful police orders."
