Defendant entered a negotiated plea of no contest to a charge of rape in the second degree. He was found guilty and sentenced to the custody of the Corrections Division for an indeterminate term, not to exceed ten years, with a minimum term of five years. He appeals, contending that the trial court failed to state its reason for the sentence imposed, as required by ORS 137.120(2),1 and that the sentence was cruel and unusual. We reverse.
ORS 137.120(2) provides that when imposing an indeterminate sentence "[t]he court shall state on the record the reasons for the sentence imposed.” The court in addressing defendant at the close of the sentencing hearing gave no reason for the sentence, but merely summarized the charges dismissed, stated what the remaining reduced charge was and the maximum sentence therefor; it then pronounced sentence.2
*452The judgment order prepared by the district attorney’s office did contain written findings of fact and stated reasons for the sentence imposed. This order, however, was signed by the court four days after it had pronounced sentence, and, although it is true that we have held in other contexts that the written order signed by the court is the one that counts, State v. Yost, 28 Or App 803, 561 P2d 657, rev den (1977),3 the application of that rule here would permit the court to provide, ex post facto, the rational process by which it imposed a sentence. If applied literally, it would permit the court to change the sentence without a hearing at which the defendant, if convicted of a felony, has the right to be present. ORS 137.030.4
The requirement of ORS 137.120(2) is not that reasons for a sentence be stated by someone somewhere in the record; rather, its function is to ensure "that the trial judge will go through the reasoning processes necessary to making such a decision.” State v. Biles, 287 Or 63, 597 P2d 808 (1979). The adoption by the trial court of a statement of reasons prepared subsequent to the hearing at which sentencing has been pronounced may raise doubts as to whether those reasons were actually the ones relied upon by the trial court at the time it made its sentencing decision or whether they were merely after-the-fact rationalizations of an unreasoned decision. In order to ensure compliance with the spirit, if not the letter, of ORS 137.120(2) the reasons for a particular sentence must be stated at the time the sentencing decision is made and announced at the hearing held for that purpose.
We therefore remand for resentencing; we need not reach defendant’s second assignment of error.
Reversed and remanded for sentencing.
ORS 137.120(2) provides:
"Whenever any person is convicted of a felony, the court shall, unless it imposes other than a sentence to serve a term of imprisonment in the custody of the Corrections Division, sentence such person to imprisonment for an indeterminate period of time, but stating and fixing in the judgment and sentence a maximum term for the crime, which shall not exceed the maximum term of imprisonment provided by law therefor; and judgment shall be given accordingly. Such a sentence shall be known as an indeterminate sentence. The court shall state on the record the reasons for the sentence imposed.”
The court’s statements at the close of the sentencing hearing were as follows:
"[THE COURT]: Mr. Evans, stand up. Do you have anything to say for yourself before being sentenced?
"[THE DEFENDANT]: No, sir. I think my attorney has said everything that I’d be able to say at one time.
"[THE COURT]: As I understand it, you were originally charged with two Class A Felonies with respect to this particular incident and then a whole bunch of Class A Felonies involving the Gurney girl, and everything has been dismissed but one Class B Felony. In other words, it’s been reduced to Rape II, which is a Class B Felony, which is punishable by an undetermined sentence not to exceed ten years in the state penitentiary.
"You are sentenced to the custody of the Department of Corrections to serve an undetermined sentence not to exceed ten years, provided, however, that a minimum term of imprisonment of not less than five years be served.
"That’s all.”
Cf. State v. Swain/Goldsmith, 267 Or 527, 517 P2d 684 (1974). That rule, however, is not a hard and fast one. State v. Sullivan, 29 Or App 55, 562 P2d 560 (1977).
ORS 137.030 provides:
"For the purpose of giving judgment, if the conviction is for a felony, the defendant shall be personally present; but if it is for a misdemeanor, judgment may be given in his absence.”