
865 P.2d 282 (1993)
STATE of Montana, Plaintiff and Respondent,
v.
Jeff Wayne BROWN, Defendant and Appellant.
No. 92-493.
Supreme Court of Montana.
Submitted on Briefs November 18, 1993.
Decided December 22, 1993.
*283 Wendy Holton, Helena, for defendant and appellant.
Joseph P. Mazurek, Atty. Gen., Michael Wellenstein, Asst. Atty. Gen., Helena, Richard J. Llewellyn, Jefferson County Atty., Boulder, for plaintiff and respondent.
WEBER, Justice.
Defendant Jeff Wayne Brown appeals the judgment by the District Court of the Fifth Judicial District, Jefferson County, which sentenced him to forty years of imprisonment. We affirm in part, vacate in part and remand.
The issues for review are restated as follows:
1. Did the District Court err in imposing two ten-year sentences under the weapon enhancement statute when the underlying charges of felony assault arose from the same incident?
2. Did the District Court err in imposing a forty-year sentence under the circumstances of this case?
On July 25, 1991, after a day spent fishing and drinking together, Jeff Wayne Brown (Brown), his brother Darren Brown and Gerald Mullaney stopped at the Two Bit Saloon in Whitehall, Montana, while a tire on Darren Brown's truck was being repaired. When the trio started to bother other bar patrons, the bartender asked them to leave the bar.
Brown left momentarily and then reentered the bar brandishing a pistol. He pointed it in the direction of the bartender, cocked it and made threatening statements. The bartender's back was turned so he was unaware of this, but one of the bar patrons told Brown to put the pistol away. Brown did so and then left the bar.
After Brown left the bar, the three men got into Darren Brown's truck. Darren Brown drove slowly past the bar while the defendant hung out the window of the truck and fired shots at the bar entrance. Although the shots frightened bar patrons and employees, no one was injured. Darren Brown then accelerated his truck and as he sped out of town, lost control of his truck and struck two pedestrians who were standing on the shoulder of the road. The impact killed one of the pedestrians and seriously injured the other.
The State charged Jeff Wayne Brown with felony assault, attempted aggravated assault and deliberate homicide by accountability. Brown later entered into a plea agreement, pursuant to which the State agreed to amend the information to charge Brown with two counts of felony assault and Brown agreed to plead guilty to the two counts of felony assault. The parties further agreed that the State would recommend a sentence of thirty years of imprisonment. The thirty years recommended by the State included the maximum sentence of ten years imprisonment for each of the two felony assault charges and a sentence enhancement of an additional five years imprisonment for each offense for using a firearm in the commission of the offenses.
Judge Frank Davis was the original presiding judge in this case. When Judge Davis accepted Brown's change of plea after the parties had entered the plea agreement, he advised Brown, among other things, that the maximum sentence he could receive was thirty years. After a remarkable community response generated by a newspaper advertisement which encouraged people to write letters to the District Court, Judge Davis recused himself from the case and Judge Robert J. Boyd assumed jurisdiction. Judge Boyd sentenced Brown to forty years with sixteen years suspended.

I.
Did the District Court err in imposing two ten-year sentences under § 46-18-221, MCA, when the underlying charges of felony assault arose from the same incident?
Section 46-18-221, MCA, provides for additional sentences for offenses committed with a dangerous weapon. In his first brief in this appeal, Brown argued that § 46-18-221, MCA, did not permit an additional ten-year sentence for each of his felony assault offenses. After Brown submitted his initial brief, this Court ruled on that issue in State *284 v. Byers (1993), ___ Mont. ___, ___, 861 P.2d 860, 879, 50 St.Rep. 1163, 1175, holding that the sentence enhancement for use of a dangerous weapon applies to each offense. Brown's reply brief concedes that Byers controls; thus, we will not further address this issue.

II.
Did the District Court err in sentencing Brown to forty years when Brown had been advised by the original judge in the proceeding that the maximum term of imprisonment was thirty years?
On appeal, Brown has asked this Court to vacate ten years of his forty-year sentence. He contends that Montana law specifically requires the sentencing court to ensure that a defendant is informed of the maximum possible punishment that may be imposed. Brown further contends that because Judge Davis advised him that the maximum sentence of imprisonment was thirty years, Judge Boyd could not impose a term of imprisonment in excess of thirty years.
The State argues that Brown in fact knew that he could be sentenced to a maximum of forty years imprisonment and that the State did not misinform him as to the maximum sentence. The State further asserts that Brown was also aware that the prosecutor's recommendation for two five-year sentences under § 46-18-221, MCA, did not bind the sentencing court, that the sentence was within the discretion of the District Court and that Brown knew that the court was not required to permit him to withdraw his guilty pleas. It further asserts that Brown cannot credibly maintain that he did not know the maximum sentence the court could impose because he acknowledged that he had discussed the sentencing laws and was informed by his attorney of the maximum sentence he could receive for the offenses. Finally, the State contends that the District Court's misstatement does not constitute reversible error because Brown was well aware of the maximum sentence that could be imposed for the offenses to which he pled guilty.
Prior to accepting the plea agreement, the District Court advised Brown as follows:
THE COURT: You understand that the State proposes to file an amended information charging you with two counts of felony assault and proposes to ask that if you're convicted of those that your sentence by  for the use of a gun. The possible punishment for that under that amended information, if I permit it to be filed, would be thirty years in the state prison. ... (Emphasis supplied.)
This statement is clearly incorrect as Brown could receive an additional sentence of ten years for each of the two felony assault offenses according to this Court's recent decision in Byers. Therefore, the correct maximum sentence included two additional sentence enhancements of ten years each  a total of forty years. See §§ 45-5-202 and 46-18-221, MCA.
A sentencing court must comply with § 46-12-210, MCA, which provides in pertinent part:
XX-XX-XXX. Advice to defendant. (1) Before accepting a plea of guilty, the court shall determine that the defendant understands the following:
........
(a) (iii) the maximum penalty provided by law, including the effect of any penalty enhancement provision ... . (Emphasis supplied.)
The court also must comply with § 46-16-105(1), MCA, which provides:
XX-XX-XXX. Plea of guilty. (1) Before or during trial, a plea of guilty may be accepted when:
(a) the defendant enters a plea of guilty in open court; and
(b) the court has informed the defendant of the consequences of his plea and of the maximum penalty provided by law which may be imposed upon acceptance of such plea. (Emphasis supplied.)
In addition to the above-quoted sections, the clear language of § 46-16-105, MCA, mandates that courts advise defendants of maximum punishment for offenses before the court may accept a plea of guilty. Further, § 46-12-204(2), MCA, requires the court to determine that a guilty plea is "voluntary" before accepting it. See also Benjamin v. *285 McCormick (1990), 243 Mont. 252, 256, 792 P.2d 7, 10 (defendant must have an adequate understanding of the consequences of his guilty plea).
Brown relies on Benjamin and In re the Matter of Orman (1986), 224 Mont. 332, 336, 731 P.2d 893, 895, to support his argument that where a defendant is incorrectly advised of the maximum penalty allowed, the sentence must be modified to reflect his understanding. In Benjamin, the defendant was advised by the court and the prosecution that he would serve approximately one year in prison. However, a further provision of his sentence required him to complete the prison's program for sexual offenders which would have resulted in at least two years imprisonment. The defendant's guilty plea was based on a specific error; i.e., that he had been misinformed as to the consequences of his plea. Benjamin, 792 P.2d at 10.
Similarly, in Orman, the correct period of time of suspending a driver's license for a second refusal to take a breathalizer test was imprisonment for one year. The arresting officers incorrectly advised the defendant several times that his license would be suspended for ninety days. We concluded, under the circumstances of that case, that even a person who was not under the influence of alcohol would reasonably have concluded that his license would be suspended for only ninety days. Orman, 731 P.2d at 895.
The State argues extensively that Brown's subjective knowledge that he could be sentenced to a maximum of forty years is crucial. We disagree. We conclude that the plain language of the code sections quoted above provides that a defendant must be advised of the maximum punishment. We further conclude that Benjamin and Orman support Brown's argument that the sentence must be modified to provide for a sentence no longer than the maximum sentence which Judge Davis advised Brown he could receive for the charged offenses.
We hold the District Court erred in imposing a forty-year sentence under the circumstances of this case. The District Court is instructed to modify the sentencing order by changing the term of imprisonment to thirty years, thereby eliminating five years from the enhancement to the sentence for each felony assault offense. The District Court is further instructed to redetermine the number of years, if any, which are to be suspended.
Affirmed in part, vacated in part and remanded.
HARRISON, TRIEWEILER, NELSON and GRAY concur.
