
177 Cal.App.3d 259 (1986)
222 Cal. Rptr. 824
THE PEOPLE, Plaintiff and Respondent,
v.
RALPH EDWARD CRENSHAW et al., Defendants and Appellants.
Docket No. D001432.
Court of Appeals of California, Fourth District, Division One.
February 5, 1986.
*261 COUNSEL
F. David Stevenson and Diane C. Campbell, under appointments by the Court of Appeal, for Defendants and Appellants.
John K. Van de Kamp, Attorney General, Michael D. Wellington and Gil P. Gonzales, Deputy Attorneys General, for Plaintiff and Respondent.
OPINION
KREMER, P.J.
Ralph Edward Crenshaw entered a negotiated plea of guilty to first degree murder (Pen. Code, § 187) and admitted using a firearm to commit the crime (Pen. Code, § 12022.5). He was sentenced to 25 years to life for the murder with a two-year enhancement for using the firearm. Under Welfare and Institutions Code section 1731.5, subdivision (c), the court ordered him housed in Youth Authority custody "until age 21." He appeals.
Michael Oryall entered a negotiated plea of guilty to second degree murder (Pen. Code, § 187) and admitted being armed with a firearm at the time of the killing (Pen. Code, § 12022, subd. (b)). He was sentenced to 15 years to life with a one-year enhancement for being armed during the murder. He also was ordered housed in Youth Authority custody until age 21. He appeals.

I
On February 5, 1983, Oceanside police officers went to a tomato field near the San Luis Rey River to investigate reports of multiple gunshot victims. *262 Four victims were found in the area and taken to the hospital. Two were dead on arrival, another was in very critical condition and the fourth in stable condition. All four were young (late teens to early twenties) undocumented Mexican farmworkers camping in the vicinity of the river bottom. The police later searched the area where the shootings occurred and found numerous bloody trails and blood spots where the victims had either stopped, or tripped and fallen in the course of attempting to flee from the ambush. The police also found 11 spent .22 caliber casings behind some bushes where the weapon had been fired.
The least injured victim told investigating officers he and his companions left their encampment to cross the river to a 7-Eleven store in a residential area. After they crossed the river, shots were fired. He saw a "white man" kneeling while holding a rifle to his face and firing it in rapid succession. He was hit in the leg by a bullet but kept running away from the gunman. While fleeing, he observed three male Caucasians entering a parked vehicle and saw one of them place what he believed to be a rifle in the driver's seat before driving away.
The two deceased victims fell about 500 feet from each other. One had been shot twice in the back; the other had suffered one gunshot wound entering his left side and passing through his entire body to the right side.
One surviving victim suffered a leg wound to the right thigh. The other suffered from two gunshot wounds, one to the back and the second to the rear of his neck. The round entering his back perforated his colon. The second round passed through the back of his head and came out near his right cheek bone. He was, for a time, considered in critical condition.
Following his arrest, Crenshaw was interviewed and admitted accompanying Oryall and a juvenile coparticipant to the crime scene on the afternoon of February 5, 1983. He said they went to the field planning to rob undocumented Mexicans. Crenshaw admitted shooting at least one of the farmworkers; he said Oryall shot the remaining victims.

II
After sentencing Crenshaw and Oryall to prison, the court ordered each defendant placed in Youth Authority custody until he reached 21 years of age. (Welf. & Inst. Code, § 1731.5, subd. (c).)
Crenshaw and Oryall contend the court abused its discretion in imposing prison terms rather than committing them to the Youth Authority. Additionally, *263 both contend the sentencing court did not have authority to order interim Youth Authority custody terminated at 21.

III
(1) Before sentencing, the court referred Crenshaw and Oryall to the Youth Authority for evaluation concerning amenability to the training and treatment offered by the Youth Authority (Welf. & Inst. Code, § 707.2). Both were found amenable to training and treatment by the Youth Authority. A recommendation of amenability to the Youth Authority is entitled to "great weight" and should be followed absent substantial countervailing circumstances. (People v. Carl B. (1979) 24 Cal.3d 212, 214-215 [155 Cal. Rptr. 189, 594 P.2d 14].)
(2a) In deciding to impose a prison term rather than commitment to the Youth Authority, the court said: "The Supreme Court has told us in People v. Carl B., 24 Cal.3d 212, that the trial court should follow the Y.A. recommendation in the absence of substantial countervailing considerations. The Court finds substantial countervailing circumstances in this case, to-wit: Two cold blooded murders compounded by the numerous aggravating circumstances that the court finds including, but not limited to, the fact that under rule 421(a)(1), the crime discloses a great deal of violence, cruelty and viciousness and callousness on the part of both defendants. The victims were particularly vulnerable. The crime involved multiple victims, and there's overwhelming evidence of premeditation, so the Court with respect to defendant Ralph Edward Crenshaw will impose the recommended term of 25 years to life plus the two-year enhancement under section 12022.5. The Court further finds circumstances in aggravation as noted by the probation officer, to-wit: That the crimes disclosed a high degree of viciousness and callousness under rule 421(a)(1) with respect to defendant Michael Oryall and the victims were particularly vulnerable and the crime involved multiple victims, to-wit: Four unarmed Mexican farmworkers, and the defendants' behavior indicates overwhelming evidence of premeditation together with the fact that the defendant Michael Oryall's prior adjudications of crimes as a juvenile have been numerous and of increasing severity, so the Court with respect to defendant Michael Oryall will impose the recommended base term of 15 years to life together with the enhancement of one year under Penal Code section 12022(a)."
Crenshaw and Oryall assert the court's decision not to place them with the Youth Authority was not based on substantial countervailing considerations. Relying on People v. Carl B., supra, 24 Cal.3d 212, they argue the crime's serious nature is not a substantial countervailing consideration.
*264 In People v. Fields (1984) 159 Cal. App.3d 555 [205 Cal. Rptr. 888], this court analyzed Carl B. and the subsequent amendment to Welfare and Institutions Code section 707.2. We said: "... In 1979, when Carl B. was decided, Welfare and Institutions Code section 707.2 stated no minor could be sentenced to state prison unless he had been remanded to CYA for a diagnostic evaluation `and the court finds after having read and considered the report submitted by the Youth Authority that the minor is not a suitable subject for commitment to the Youth Authority.' In Carl B., the Supreme Court held a recommendation of amenability by the CYA is entitled to `great weight' (24 Cal.3d at pp. 214-215) and should be followed absent `substantial countervailing considerations' (id., at p. 215). Such countervailing considerations did not include either the seriousness of the crime, of itself, or the fact CYA commitment might be for less time than a prison term (id., at p. 219).
"In 1982, however, the Legislature amended Welfare and Institutions Code section 707.2 deleting the language: `and the court finds after having read and considered the report submitted by the Youth Authority that the minor is not a suitable subject for commitment to the Youth Authority,' and added a second paragraph stating: `The need to protect society, the nature and seriousness of the offense, the interests of justice, the suitability of the minor to the training and treatment offered by the Youth Authority, and the needs of the minor shall be the primary considerations in the court's determination of the appropriate disposition for the minor.'
(3) "As amended, Welfare and Institutions Code section 707.2 specifically directs the court to consider the nature and seriousness of the offense and implicitly allows the court to consider the CYA's parole policies pursuant to the protection of society or interests of justice criteria. Moreover, the amendment also appears to alter the weight given to the CYA's recommendation of amenability since the court is no longer required to make a specific finding `the minor is not a suitable subject for commitment to the Youth Authority,' but rather is to consider the amenability recommendation as one of several `primary considerations in the court's determination of the appropriate disposition of the minor.'" (Fns. omitted.) (People v. Fields, supra, 159 Cal. App.3d at pp. 566-567.)
(2b) In Fields, we remanded for further proceedings because "[w]hile the court properly considered the factors listed in Welfare and Institutions Code section 707.2, it ignores the fact CYA can provide treatment and is the recommended place for treatment." (People v. Fields, supra, at p. 569.) We specifically noted our action was not a holding commitment to the Department of Corrections was precluded. (Ibid.)
*265 As in Fields, the record here indicates the trial court considered briefs, reports and argument touching all of the factors listed in Welfare and Institutions Code section 707.2. Unlike Fields, the record also indicates the court considered the ability of the Youth Authority to provide treatment but elected to afford that treatment through Youth Authority housing under Welfare and Institutions Code section 1731.5.
On a record showing cold-blooded murder of defenseless farmworkers, and in light of the factors listed in Welfare and Institutions Code section 707.2, we cannot say the trial court abused its discretion in determining the seriousness of the crimes, the need to protect society and the interests of justice outweighed the needs of the defendants and their amenability to treatment especially where the latter two considerations were at least partially accommodated through ordering both individuals housed at Youth Authority institutions.[1]

IV
(4) Crenshaw and Oryall argue the trial court lacked authority to order return to prison from Youth Authority housing at age 21. They are correct. We will modify both sentencing orders to strike the conditions requiring return to prison custody at age 21.
Welfare and Institutions Code section 1731.5 provides: "... In sentencing a person under the age of 21 years, the court may order that the person shall be transferred to the custody of the Youth Authority pursuant to this subdivision. When the court makes such an order and the Youth Authority fails to accept custody of the person, the person shall be returned to court for resentencing. The transfer shall be solely for the purposes of housing the inmate and allowing participation in the programs available at the institution by the inmate, who, in all other aspects shall be deemed to be committed to the Department of Corrections ... and the Board of Prison Terms....
".... .... .... .... .... .... .
"The duration of the transfer shall extend until the Director of the Youth Authority orders the inmate returned to the Department of Corrections, the inmate is ordered paroled by the Board of Prison Terms, the inmate's term of imprisonment is completed as otherwise provided by law, or the inmate reaches the age of 25, whichever first occurs."
*266 The court's orders limiting Youth Authority housing to age 21 are not authorized by section 1731.5 or by any other provision of law. The orders also interfere with the discretion afforded the Director of the Youth Authority. Accordingly, we strike the improper conditions.
In point is People v. Lara (1984) 155 Cal. App.3d 570 [202 Cal. Rptr. 262]. There the court considered the legality of a sentence committing an individual to state prison with directions to California corrections officials to transfer the inmate to federal custody under Penal Code section 1170.9. The Court of Appeal reversed, holding the section authorized only a direct commitment to cooperating federal authorities and not a sentence to state prison with a direction to transfer. The court noted: "Penal Code section 12 imposes a duty upon the sentencing court to impose the punishment prescribed by law. (In re Sandel (1966) 64 Cal.2d 412, 415 [50 Cal. Rptr. 462, 412 P.2d 806].) A sentencing court has no discretion to deviate from the punishment prescribed by statute. [Citations omitted.]" (People v. Lara, supra, 155 Cal. App.3d at p. 574.)
Nothing in Welfare and Institutions Code section 1731.5 or any other provision of law brought to our attention authorizes an order terminating housing at 21. An order purporting to do so impinges upon the authority given the director by section 1731.5 to retain the inmate until age 25 and to eject the inmate from the program at any age should the director elect to do so. (See People v. Lara, supra, at p. 576; People v. Thomas (1976) 65 Cal. App.3d 854, 858 [135 Cal. Rptr. 644]; People v. Flower (1976) 62 Cal. App.3d 904, 912-913 [133 Cal. Rptr. 455].)
(5) When, as here, a court pronounces an illegal sentence, that sentence must be vacated (People v. Hunt (1982) 133 Cal. App.3d 543, 564 [184 Cal. Rptr. 197]). A remand for resentencing is not required.
The intention of the trial court is plain. The court intended to sentence both defendants to prison and to house both individuals at the Youth Authority in accordance with Welfare and Institutions Code section 1731.5. The People did not oppose Youth Authority housing so long as lengthy prison terms were imposed. The court's error occurred when it uncritically accepted defense counsels' representations the section limited Youth Authority housing to age 21.
An order striking the conditions defendants be returned to state prison at age 21 will vacate the illegal sentences, carry out the trial court's intention and accord with the statutory scheme. In doing so, we emphasize the remaining portions of the trial court's sentences remain in effect. Both defendants remain committed to the Department of Corrections for the terms *267 imposed; both defendants are to be housed at the Youth Authority in accordance with Welfare and Institutions Code section 1731.5 and both defendants are subject to transfer to Department of Corrections custody in accordance with the terms of section 1731.5.
Each judgment is modified by striking the condition the defendant is to be returned to state prison custody from Youth Authority housing at age 21. In all other respects, the judgments are affirmed.
Staniforth, J., and Wiener, J., concurred.
Appellants' petition for review by the Supreme Court was denied May 22, 1986. Reynoso, J., was of the opinion that the petition should be granted.
NOTES
[1]  People v. Javier A. (1985) 38 Cal.3d 811 [215 Cal. Rptr. 242, 700 P.2d 1244] is not controlling since it, like Carl B., supra, involves a sentencing under the preamendment version of Welfare and Institutions Code section 707.2.
