
465 So.2d 709 (1985)
STATE of Louisiana
v.
Rod COLEMAN.
No. 84-K-1223.
Supreme Court of Louisiana.
April 1, 1985.
Rehearings Denied May 2, 1985.
*710 Paula Cobb, Baton Rouge, for applicant.
William J. Guste, Jr., Atty. Gen., Barbara Rutledge, Asst. Atty. Gen., Ossie Brown, Dist. Atty., Kay Kirkpatrick, Susan Ponder, Asst. Dist. Attys., for respondent.
DENNIS, Justice.
Is a five year hard labor sentence for attempted manslaughter "illegal" because the district attorney failed to charge defendant, or timely seek enhancement of his sentence, under statutes mandating additional penalties for his criminal use of a firearm? The court of appeal held that such a sentence is "illegal" and "may be corrected at anytime." State v. Coleman, 451 So.2d 185 (La.App. 1st Cir.1984). We reverse. The sentence was not illegal but valid because it was based upon and comported with a valid and sufficient statute, bill of information and verdict. See La.C. Cr.P. art. 872. The district attorney's failure to charge the defendant with use of a firearm or to move timely for enhancement of penalty does not make any aspect of the prosecution or the sentence invalid because he constitutionally has charge of every prosecution by the state and therefore may determine whom, when and how to prosecute. La. Const., Art. 5 § 26; See La.C. Cr.P. art. 61. Consequently, the district attorney's petition to enhance a sentence for firearm use constituted a motion to amend or change a legal, not an illegal, sentence. Since the petition was filed after the defendant had been granted an order of appeal and after execution of the sentence had begun, the jurisdiction and authority of the trial court to affect the legal sentence had been divested. La.C.Cr.P. art. 881, 916.
During an altercation between three white high school students and a group of black youths in a predominantly black residential district of Baton Rouge, one of the students was seriously wounded by a firearm. Defendant, seventeen year old Rod Coleman, was charged by bill of information with attempted first degree murder and pleaded not guilty. After a trial he was convicted by a jury of attempted manslaughter and sentenced to five years at *711 hard labor. Defendant appealed and the court of appeal affirmed his conviction and sentence. State v. Coleman, 432 So.2d 323 (La.App. 1st Cir.1983). The execution of defendant's sentence began approximately one month later on June 20, 1983.
After the defendant's appeal had been decided and the execution of his sentence had begun, the state on July 8, 1983 petitioned the trial court to amend or change the defendant's sentence. After a hearing, the trial court increased the defendant's punishment to a total of seven years at hard labor and provided that this sentence shall be served without benefit of parole, probation or suspension of sentence and that the last two years shall be without credit for good time. The trial court was of the opinion that its action was required by the firearm penalty enhancement statutes, which mandate additional penalties for offenders who use firearms during the commission of offenses. See La.C.Cr.P. art. 893.1 and La.R.S. 14:95.2. Because the evidence in the trial reflected that defendant had used a firearm the trial court concluded that the punishment originally imposed was an "illegal" sentence which "may be corrected at anytime by the court that imposed the sentence." La.C.Cr.P. art. 882. The court of appeal affirmed the trial court's judgment on the same theory, 451 So.2d 185, and we granted certiorari. 456 So.2d 160 (La.1984).
The original sentence is not illegal. The prosecution was based upon the attempt and first degree murder sections of the criminal code. La.R.S. 14:27, 30. The bill of information charged the defendant with attempted first degree murder under these statutes. Neither the statutes nor the bill of information notified the defendant or required proof by the state that use of a firearm was an essential element of the charged offense. The responsive verdict of "guilty of attempted manslaughter" was responsive to and consistent with the statutes and the indictment. See La.C.Cr.P. art. 814. The original sentence of five years at hard labor comported with and was based upon the valid statutes, bill of information and verdict. Therefore, the sentence was valid and legal. See La.C. Cr.P. art. 872. Cf. State v. Patterson, 384 So.2d 790 (La.1980).
Nothing in the firearm penalty enhancement statutes overrides these precepts or authorizes a court to declare "illegal" a sentence which is valid under them. The firearm statutes badly need comprehensive legislative revision because they raise numerous constitutional questions and are subject to differing statutory interpretations. See, e.g., Joseph, Developments in the Law, 1980-1981, Postconviction Procedure, 42 La.L.Rev. 693, 701-704 (1982). We think it is clear, however, that whatever else the statutes sanction or imply, they do not disturb the basic scheme of our law under which a sentence based upon and comporting with a valid and sufficient statute, indictment and verdict constitutes a legal sentence.
Assuming that the firearm enhancement statutes establish higher grades of offenses and authorize postconviction enhancement of sentences, the district attorney's decision to charge the defendant with a lesser grade of an offense or his election to waive enhancement of the sentence does not invalidate an indictment, verdict or sentence. The district attorney constitutionally has charge of every criminal prosecution by the state in his district. La. Const., Art. 5 § 26. He may decide whom, when, and how to prosecute. La.C. Cr.P. art. 61. Consequently, the district attorney's conscious or inadvertent failure to prosecute or to seek enhancement of a sentence to the full extent permitted by law does not render an indictment, verdict or sentence illegal. Selectivity in enforcement is not in itself a constitutional violation unless based upon an unjustifiable standard such as race, religion or other arbitrary classification. Olyer v. Boles, 368 U.S. 448, 82 S.Ct. 501, 7 L.Ed.2d 446 (1962).
Because the original sentence was valid, it could be modified only in accordance with the rules for altering a legal sentence. The court may amend or change *712 a legal sentence, within the legal limits of its discretion, prior to the beginning of execution of the sentence. La.C.Cr.P. art. 881. Moreover, the jurisdiction of the trial court is divested and that of the appellate court attaches, upon the entering of the order of appeal. Thereafter, the trial court has no jurisdiction over the matter, with few exceptions, none of which authorizes a change in a legal sentence. La.C.Cr.P. art. 916. Accordingly, because the execution of defendant Coleman's legal sentence had begun and the jurisdiction of the trial court had been divested prior to the time that the court attempted to amend the sentence, the trial court lacked the authority to modify the sentence.
The firearm penalty enhancement statutes do not authorize a court to ignore constitutional and statutory limits on its power simply because they are framed in mandatory terms. Virtually all criminal penalty provisions are stated in mandatory terms. Usually a statute states that "whoever commits the crime of ... shall be imprisoned" for a term as prescribed therein. See e.g., La.R.S. 14:31, La.R.S. 14:42, La.R.S. 14:44. Such language, however, is not intended to authorize a court to correct a district attorney in the exercise of his constitutional and statutory discretion to proceed under a particular provision when an offender's conduct is criminal according to several statutes or to selectively enforce enhancement statutes. See La. Const., Art. 5, § 26; La.R.S. 14:4. Nor does such mandatory language require that a court exceed the bounds of its jurisdiction or authority to impose what it considers to be the correct punishment upon a person who committed but was not convicted of a particular crime. If this were not so, countless sentences based on plea bargains and verdicts of lesser included offenses could be called into question when the evidence in hindsight might be said to warrant a conviction of a more serious crime and hence a heavier penalty.
Accordingly, the judgment of the court of appeal and trial court are reversed and set aside and the original sentence is reinstated.
REVERSED; ORIGINAL SENTENCE REINSTATED.
MARCUS, J., dissents and assigns reasons.
BLANCHE, J., dissents for reasons assigned by MARCUS, J.
MARCUS, Justice (dissenting).
La.R.S. 14:95.2 requires an additional sentence of two years for attempted manslaughter with use of a firearm. The original five-year sentence complied with La. Code Crim.P. art. 893.1, but not with La. R.S. 14:95.2. Thus, it was less than the mandatory sentence required by law and constituted an illegal sentence which can be corrected by the trial court at any time. La.Code Crim.P. art. 882. To find, as does the majority, that the original five-year sentence was legal would imply that the imposition of the additional two-year sentence required by La.R.S. 14:95.2 is discretionary rather than mandatory. Accordingly, I respectfully dissent.
