
220 Wis.2d 468 (1998)
583 N.W.2d 843
STATE of Wisconsin, Plaintiff-Respondent,
v.
Scott A. MAGNUSON, Defendant-Appellant.
Nos. 97-3288-CR, 98-0190.
Court of Appeals of Wisconsin.
Submitted on briefs May 18, 1998.
Decided June 9, 1998.
*469 On behalf of the defendant-appellant, the cause was submitted on the brief of T. Gregory Amann of Ellsworth.
On behalf of the plaintiff-respondent, the cause was submitted on the brief of James E. Doyle, attorney *470 general, and Sandra L. Tarver, assistant attorney general.
Before Cane, P.J., Myse and Hoover, JJ.
HOOVER, J.
Scott Magnuson appeals a judgment and an order denying postconviction relief. Magnuson pled guilty to two burglary charges, contrary to § 943.10(1)(a), STATS., as a repeater, § 939.62, STATS. On appeal, he contends that the court erred by imposing two concurrent twelve-year prison sentences. We conclude that judicial estoppel precludes him from raising this argument and, alternatively, the court properly exercised its discretion when imposing the sentence. Accordingly, we affirm.
Magnuson was charged with three counts of felony theft and three counts of burglary, all as a repeater. He waived his preliminary hearing and pled guilty to two counts of burglary as a repeater. At sentencing, Magnuson's probation agent recommended the court impose concurrent terms of twelve years in prison for each conviction, stay the sentences, and place Magnuson on ten years' probation concurrent with a probation term he was serving in Pierce County. The assistant district attorney joined in the recommendation, and the defense attorney stated that he and Magnuson also agreed with the proposal. The court accepted the agreement. It also imposed certain conditions of probation, including four months in jail.
Magnuson filed a motion asking the court to modify the sentence to eliminate the requirement that he serve jail time as a condition of probation. He did not object to the length of the sentence. The court modified the conditions of probation, including staying for a year the four-month jail term. Within the year, however, *471 Magnuson committed another felony and his probation was revoked. On appeal, Magnuson argues that the twelve-year concurrent prison sentences are excessive.
[1]
We first determine whether the judicial estoppel doctrine precludes Magnuson's argument. This issue involves the application of law to undisputed facts. It therefore presents a question of law reviewed de novo. Ball v. District No. 4, Area Bd., 117 Wis. 2d 529, 537, 345 N.W.2d 389, 394 (1984).
[2]
The doctrine of judicial estoppel recognizes that "[i]t is contrary to fundamental principles of justice and orderly procedure to permit a party to assume a certain position in the course of litigation which may be advantageous, and then after the court maintains that position, argue on appeal that the action was error." State v. Gove, 148 Wis. 2d 936, 944, 437 N.W.2d 218, 221 (1989). Wisconsin has recognized and applied judicial estoppel in several different contexts. See State v. Edwardsen, 146 Wis. 2d 198, 209-10, 430 N.W.2d 604, 609 (Ct. App. 1988); State v. Hardwick, 144 Wis. 2d 54, 61, 422 N.W.2d 922, 925 (Ct. App. 1988); State v. Washington, 142 Wis. 2d 630, 635, 419 N.W.2d 275, 277 (Ct. App. 1987).
[3]
We conclude that Magnuson is judicially estopped from asserting that the two twelve-year concurrent sentences are excessive. Although Magnuson contends he did not agree to the recommended sentence, the record belies his claim. Magnuson's probation officer set forth the recommendation in the presentence investigation report (PSI). The court asked Magnuson if he reviewed the PSI, and Magnuson's attorney stated that both he and Magnuson had reviewed it. After assistant *472 district attorney Francis Collins concurred with the recommendation, defense counsel stated "we're also in agreement with the recommendations and also with what Mr. Collins has stated." During his allocution, Magnuson expressed no objection to the proposed sentence. The record thus demonstrates that Magnuson agreed to the proposed sentence. He cannot agree to the recommendation of an imposed and stayed sentence, violate probation, and then take the position on appeal that the sentence was excessive. If Magnuson objected to the recommendation, he should not have entered into the agreement.
[4]
Alternatively, we conclude that the circuit court properly exercised its discretion when sentencing Magnuson. In reviewing whether a court erroneously exercised sentencing discretion, we consider whether it applied the appropriate factors and whether the sentence imposed was excessive. See State v. Glotz, 122 Wis. 2d 519, 524, 362 N.W.2d 179, 182 (Ct. App. 1984). The primary factors a court considers in fashioning a sentence are the gravity of the offense, the character of the offender, and the need for public protection. State v. Iglesias, 185 Wis. 2d 117, 128, 517 N.W.2d 175, 178 (1994). The weight of the factors is within the circuit court's discretion. Id. Imposition of a sentence may be based on any of the three primary factors after all relevant factors have been considered. See State v. Curbello-Rodriguez, 119 Wis. 2d 414, 434, 351 N.W.2d 758, 768 (Ct. App. 1984).
[5]
The record demonstrates that the court considered all three primary factors and properly exercised its discretion. Each conviction carried a possible sentence of sixteen years in prison, for a maximum sentence of *473 thirty-two years. See §§ 943.10(1)(a), 939.50(3)(c), and 939.62(1)(b), STATS. Before imposing the two concurrent twelve-year prison sentences, the court considered the seriousness of the offenses, Magnuson's character and "lengthy involvement with law enforcement," and the need to protect the public. It found that the severity of Magnuson's offenses, although property crimes, was significant. Despite this finding, it sentenced Magnuson to substantially less than the maximum prison term. The court's reasons for imposing the sentence are supported by the record, and we uphold its use of discretion.
By the Court.Judgment and order affirmed.
