
31 Md. App. 310 (1976)
356 A.2d 320
FRANCES ESTER SMITH
v.
STATE OF MARYLAND.
No. 887, September Term, 1975.
Court of Special Appeals of Maryland.
Decided April 15, 1976.
The cause was submitted on briefs to ORTH, C.J., and MENCHINE and MASON, JJ.
*311 Submitted by Jack B. Rubin and Lee Gordon, Assigned Public Defenders, for appellant.
Submitted by Francis B. Burch, Attorney General, John A. Austin, Assistant Attorney General, William A. Swisher, State's Attorney for Baltimore City and Joseph Wase, Assistant State's Attorney for Baltimore City, for appellee.
ORTH, C.J., delivered the opinion of the Court.
On this appeal Frances Ester Smith does not challenge her conviction of murder in the second degree, entered in the Criminal Court of Baltimore on 2 April 1975 upon her plea of guilty thereto.[1] She is unhappy, however, with her punishment. We trace the long and tortuous journey leading to the ultimate sentence imposed.
On 1 February 1973 in the Criminal Court of Baltimore, Mrs. Smith, charged with the homicide of her husband, Johnny James Smith, was found guilty by a jury of murder in the second degree. On 8 May 1973, after a motion for a new trial was heard and denied and a medical report was obtained, she was committed to the care of the Commissioner of Correction for 30 years from 1 February 1973. She appealed on 18 May 1973.[2] The Court of Special Appeals affirmed the judgment, Smith v. State, 20 Md. App. 254 (1974), and the mandate was issued on 21 March 1974. On 6 May 1974 Mrs. Smith moved the trial court for a reduction of sentence. Rule 764, § b 1. The motion was granted, and on 20 May the sentence was reduced to 24 years from 1 February 1973. In the meantime, on 17 May 1974, the Court of Appeals ordered that a writ of certiorari issue to the Court of Special Appeals. By a majority opinion filed 25 November 1974, Smith v. State, 273 Md. 152, the Court of Appeals reversed the judgment of the Court of Special *312 Appeals, which, then, as directed, vacated its mandate on 8 January 1975, reversed the judgment of the Criminal Court of Baltimore and remanded the case for a new trial. Thereupon, on 2 April 1975, Mrs. Smith pleaded guilty to murder in the second degree. The plea was accepted, and verdict rendered accordingly.
At the penalty stage of the trial defense counsel informed the court that there had been plea negotiations. The prosecutor and defense counsel suggested that a pre-sentence investigation be made. Regardless of what the investigation disclosed, the State indicated, it would recommend that the sentence not exceed 15 years. If the report of the investigation were "favorable", that is, "[i]f the report spoke extremely well of Mrs. Smith and her prospects for the future, something along those lines," the State would have no objection to Mrs. Smith striking her plea of guilty to murder in the second degree and entering a plea to manslaughter. The State would not oppose "whatever the probation report comes up with, in the way of a recommendation." The court held the sentencing sub curia. It referred Mrs. Smith "to the Probation Department for complete evaluation" and set disposition for 23 April 1975.
On 23 April 1975 the matter of disposition came before the court. Counsel commented on the probation report which had been filed. "In the light of the findings of the Probation Department in the probation report, in light of the findings of the Medical Division of the Supreme Bench in 1973, and in light of the mitigating circumstances which are present in this case," the State adhered to the bargain that it would recommend a sentence not to exceed 15 years. The judge announced the sentence. Finding probation "totally unrealistic", he said:
"I concluded that the appropriate sentence to be imposed would be imposed as starting as of now, without regard to her previous incarceration, which has been a period of nineteen months. And the sentence is to be twelve years in the custody of the Department of Corrections. That sentence is to start as of today. So that in effect, the nineteen *313 months that she has already served is eliminated. Half of her sentence from the twenty-four years, the first twelve years have already been taken care of by her nineteen months incarceration under this sentence, because this is a new sentence of twelve years starting today."
Defense counsel entreated the court for a short delay in the execution of sentence: "This young lady has two children at home. She does have an ailing mother, and we will present her to the authorities on Monday." The court granted the request, postponed the execution of the sentence until Monday, 28 April, and continued bail, observing: "She will be required to surrender herself to the Sheriff."
On 28 April 1975, when Mrs. Smith appeared before the court, the judge changed the sentence. He explained:
"... I found that the sentence which I imposed was not in accord with a recent act of the Legislature.
Mrs. Smith originally, in 1973 had been sentenced to a term of thirty years incarceration as a result of a conviction of murder in the second degree. Later, the trial Judge in that case, Judge Harris, reduced that sentence to twenty-four years. Later, there was a reversal in the Court of Appeals. And the case was re-tried before me on April 22nd, when she submitted under a plea of guilty to murder in the second degree. So, that the previous sentence imposed on Mrs. Smith was a term of twenty-four years. She had been incarcerated for a period of approximately nineteen months. The dates I have are from May 8th of 1973, until December 23rd, 1974.
And in sentencing Mrs. Smith, I imposed a term of twelve years imprisonment which was one-half of the twenty-four year term. However, that was done on the basis of not allowing any credit for the nineteen months, because I thought it would be easier to keep the books straight if we just wiped *314 out the first twelve years with the nineteen months taking care of that, and giving her a new sentence of twelve years.
It developed that it is mandatory that any time spent serving a sentence, or awaiting trial must be allowed for. Under those circumstances, the twelve year sentence is being stricken as an illegal sentence, and a different sentence is going to be imposed."
He imposed the new sentence:
"The sentence is a term of fifteen years imprisonment with credit given for the nineteen months imprisonment previously served. So that the present term is a term of fifteen years with credit given for the period served from May 8th, 1973, through December 23rd, 1974."[3]
Defense counsel took exception, pointing out that there were no new circumstances to support the increased sentence. The judge commented: "That has nothing to do with anything other than the legality of the sentence." Defense counsel persisted: "I understand, but the point being, she was exposed on Wednesday to a maximum of twelve years, not being exposed to a maximum of fifteen years, which is three years greater than the sentence she had Wednesday, regardless of when she may or may not be eligible for parole. On those grounds, if the Court pleases, we take exception to your Honor's sentence." The court stated that "the exception will be noted." Mrs. Smith forthwith, on 28 April 1975, noted an appeal.[4] The curtain did not yet fall, however, in the lower court. We find in the record an order signed by the *315 trial judge under date of 22 May 1975 which is not mentioned in either the brief of Mrs. Smith or the brief of the State. It reads:
"On April 28, 1975, the above named defendant was sentenced to a term of fifteen years under the jurisdiction of the Department of Correction, the sentence to date from September 8, 1973. It was intended that the defendant be given full credit for all time spent in incarceration. It has now been ascertained that the defendant's incarceration began on February 1, 1973.
IT IS, THEREFORE, ORDERED this 22d day of May, 1975, that the sentence under the above indictment be corrected to read fifteen years under the jurisdiction of the Department of Correction dating from February 1, 1973."
The order of 22 May 1975 is reflected in the docket entries under that date. The entry concludes: "Copy of corrected commitment filed."
We list the various sentences from time to time imposed:

Original Conviction
Sentence of 8 May 1973: 30 years from 1 February 1973.
Sentence of 20 May 1974: 24 years from 1 February 1973.

Conviction on Remand
Sentence of 23 April 1975: 12 years from 28 April 1975.
    Sentence of 28 April 1975: 15 years with credit given
                                for time served for the
                                period from 8 May 1973
                                through 23 December 1974.
Sentence of 22 May 1975: 15 years from 1 February 1973.
The statute which the trial judge referred to in striking as illegal the sentence he imposed on 23 April 1975 was Acts 1974, ch. 735, § 1, effective 1 July 1974, codified as Art. 27, § 638C. Credit is required to be given for time spent in custody, under subsection a before conviction, and under subsection b against a subsequent sentence when a sentence *316 is set aside. In relevant part the statute provides that any person who is convicted and sentenced shall receive credit for all time spent in the custody of any state, county or city jail, correctional institution, hospital, mental hospital or other agency as a result of the charge for which sentence is imposed or as a result of the conduct on which the charge is based. Subsection a. A person whose sentence is set aside as the result of direct or collateral attack and who is reprosecuted or resentenced for the same offense or for another offense based on the same transaction shall receive credit against the term of a definite sentence for all time spent in custody under the prior sentence. Subsection b. In each case the term of the sentence shall be diminished by the credit. By subsection (d) this required credit shall be awarded by the trial judge at the time of sentencing. "After having communicated with the parties, the judge shall inform the defendant and shall state on the record the amount of time that is to be credited and the facts upon which the provision for credit is based."
Maryland Rule 764 speaks to the power of the trial court to revise a sentence imposed. Section a flatly declares: "The court may correct an illegal sentence at any time." Section b 1 gives the court revisory power and control over the judgment or other judicial act forming a part of the proceedings for a period of 90 days after the imposition of sentence, or within 90 days after the receipt by the court of a mandate issued by the Court of Appeals or Court of Special Appeals upon affirmance of the judgment or dismissal of appeal, or thereafter pursuant to motion filed within such period. Expressly included in such authority is revisory power and control over a sentence. Manifestly, in the light of the power bestowed by § a over an illegal sentence, § b 1 contemplates a legal sentence. The power to revise a sentence under § b 1, however, is limited: "The court may, pursuant to this section, modify or reduce, but shall not increase the length of a sentence."[5]
*317 We examine the various sentences imposed after remand in the light of the statute and rule.

Sentence of 23 April 1975
This sentence imposed a term of imprisonment of 12 years from 28 April 1975. With respect to the definite term of 12 years it was clearly legal. Twelve years was well within the maximum of 30 years authorized upon conviction of murder in the second degree by Code, Art. 27, § 414, and there was no showing that the sentence was dictated by passion, prejudice, ill will or any unworthy motive. Mullins v. State, 12 Md. App. 222, 224-225 (1971). What was illegal about the sentence was that credit was not given against the term of imprisonment "for all time spent in custody" on the charge so that the 12 years would be "diminished thereby" as required by Art. 27, § 638C(b). Had there been compliance with the statute, the practical effect would be that Mrs. Smith would have been subject to imprisonment for 12 years in all because credit given to diminish the 12 year term would be equal to time actually spent in custody.

Sentence of 28 April 1975
This sentence imposed a term of imprisonment of 15 years with credit for time served for the period from 8 May 1973 through 23 December 1974. The effect of this sentence, assuming that the time considered as served was accurate, was that Mrs. Smith was subject to imprisonment for a total of 15 years as the credit given was equal to and offset by the time served. Of course, had she in fact been in custody for a longer time than that for which credit was given, the actual time she would be subject to serve would be longer than 15 years. In either event, the sentence of 28 April 1975 was *318 longer than the sentence of 23 April 1975 and was, therefore, in violation of Rule 764, § b 1 which prohibits the court from increasing the length of a sentence. We note that if a judge is required to increase a sentence to make it a legal sentence, see State ex rel. Sonner v. Shearin, 272 Md. 502 (1974), he is not acting under § b 1 but under § a.

Sentence of 22 May 1975
This sentence imposed a term of imprisonment of 15 years from 1 February 1973. From 1 February 1973 to 28 April 1975 comprised 2 years, 2 months, 28 days. Assuming that this was in fact the correct time Mrs. Smith spent in custody on the charge, the practical effect would be that she would be subject to be imprisoned for 15 years in all. As in the prior sentence the time for which credit was given by dating the sentence back was equal to and offset by the time spent in custody. Of course, had she in fact been in custody for a longer time than that for which credit was given, her actual incarceration would exceed 15 years. Had she in fact been in custody for a shorter time than that for which credit was given, her actual incarceration would be less than 15 years. Accepting, however, for the purpose of this immediate discussion, that her incarceration began on 1 February 1973, as the court stated in its order, and continued without break thereafter, this sentence also was longer than the sentence imposed on 23 April 1975 and therefore violated Rule 764, § b 1.
We point out that the record before us does not support the conclusion that Mrs. Smith was continuously incarcerated from 1 February 1973. It does not disclose when she was first taken into custody, but according to the docket entry of 16 October 1972 the court ordered that she be escorted from the Women's Detention Center to a funeral home to view the remains of her husband. When the presentment was filed on 18 October 1972 and capias issued it was returned "cepi Jail". On 17 November 1972, recognizance in the amount of $1,000 was taken. When she was found guilty on 1 February 1973, the court authorized bail of $5,000 pending disposition and bail in that amount *319 was taken on 8 February 1973. She was sentenced on 8 May 1973 and apparently incarcerated. On 23 December 1974 recognizance in the amount of $5,000 was taken pending disposition of the writ of certiorari issued by order of the Court of Appeals. It seems that thereafter she remained free on bail until 28 April 1975.

Summary
The sentence of 23 April 1975 was legal with respect to the imposition of a term of imprisonment of 12 years. It was illegal only in that it did not grant credit for time spent in custody.
The sentence of 28 April 1975 was illegal because it increased the length of the sentence imposed on 23 April.[6]
The sentence of 22 May 1975 was illegal in that on its face it increased the length of the sentence imposed on 23 April. It also presents other problems. The practical effect of the order was that it reduced the sentence of 28 April by giving more credit for time spent in custody. We cannot ascertain from the record whether this was done in open court after notice to Mrs. Smith and the State's Attorney as required by Rule 764, § b 2 and in conformance with Art. 27, § 638C (d), requiring that "the judge shall inform the defendant and shall state on the record the amount of time that is to be credited and the facts upon which the provision for credit is based." More significantly the order was issued after the appeal had been noted. Ordinarily, the trial court loses jurisdiction over the case when an appeal is filed. State v. McCray, 267 Md. 111, 145 (1972).

DECISION
The State argues that the trial judge struck the 12 year sentence as illegal. By the State's reasoning, that sentence was therefore a nullity, and the judge was free to sentence *320 again as if the 12 year sentence had never been imposed. We do not agree because we believe that the trial judge could not strike the 12 year term he had imposed so as to thereafter increase the sentence. As we have indicated, the 12 year term imposed was legal, and the only aspect of the sentence that was illegal was the lack of credit for time served. Rule 764, § a permitted that defect to be corrected, but it did not empower the judge to strike the 12 year term. It is correct that § b 1 of the Rule gives the trial judge, within the 90 day period, broad powers over a sentence even though it has been imposed. But those powers permit the modification or reduction of the sentence. Costello v. State, 237 Md. 464, 472 (1965). The judge may not increase it. Brown v. State, 237 Md. 492, 502 (1965) indicates that Rule 764, § b prohibits the increase of a sentence imposed, even when its execution was suspended.[7]
We hold that the striking of the sentence imposed on 23 April 1975 was error in the circumstances, that the sentence imposed on 28 April 1975 was illegal, and that the order of 22 May 1975 was improper. The sentence of 28 April 1975 is vacated and the order of 22 May 1975 is reversed. The sentence of 23 April 1975 of 12 years in the care of the Commissioner of Correction is reinstated with modification. The trial court shall, by proceedings it deems appropriate, determine the actual time Mrs. Smith spent in custody on the charge of which she was convicted and shall give credit against the 12 year term for such time so that such term shall be diminished thereby pursuant to Code, Art. 27, § 638C (a) and (b). We remand the case in order that the trial court may pronounce a proper sentence, Rule 1071, § b, in the manner required by Art. 27, § 638C (d) and Rule 764, § b 2.[8]


*321 THE MOTION TO DISMISS THE APPEAL

The State in its brief moves to dismiss the appeal, Rule 1036, § d, as not permitted by law, Rule 1035, § b 1. The general rule is that there may not be a direct appeal from a refusal to modify, Wilson v. State, 227 Md. 99, 100-102 (1961), or to strike out, Harris v. State, 241 Md. 596, 598 (1966), a sentence. Wilson and Harris and under their authority, the Court of Special Appeals in Dawson v. State, 17 Md. App. 316 (1973), and the Court of Appeals again in William Johnson, Jr. v. State, 274 Md. 29, decided 24 February 1975, dismissed such appeals. In Johnson, at 44, the Court of Appeals pointed out that as both it and this Court have held that the provisions of Maryland Rule 764, § a and § b 1 are each construed to be a statutory remedy within the meaning of the Uniform Post Conviction Procedure Act, the dismissal of the appeal was without prejudice to seek relief under post conviction procedures.[9]
Less than two months after the opinion in William Johnson, Jr. v. State, supra, was filed, the Court of Appeals decided Kenneth Ricardo Johnson v. State, 274 Md. 536. The Court of Special Appeals had affirmed the judgment on Johnson's burglary conviction, 21 Md. App. 214 (1974), and the Court of Appeals granted his request for certiorari so it "could review the prison sentence he received for that criminal act." The writ directed that the scope of review was "limited solely to the question [of] whether the [trial] court denied ... [Johnson] due process by sentencing him `to a longer term based upon his not admitting guilt but instead pleading not guilty and testifying in his own behalf'." 274 Md. at 537. Thus, there were no issues concerning the guilt stage of the trial before the Court of Appeals. In holding that the trial judge in imposing sentence impermissibly *322 considered Johnson's election to stand trial, a unanimous Court said, at 538:
"In reviewing the legality of this sentence we are fully cognizant of the fact that, in this State, the awesome responsibility of imposing sentence is within the exclusive domain of the trial judge (subject to modification pursuant to the review of criminal sentence provision contained in Maryland Code (1957, 1971 Repl. Vol., 1974 Cum. Supp.) Art. 27, § 645JA-645JG), and thus his determination in this regard cannot be reevaluated upon appellate review unless either it is based upon an impermissible consideration, Costello v. State, 237 Md. 464, 469, 206 A.2d 812 (1965); Gleaton v. State, 235 Md. 271, 277, 201 A.2d 353 (1964); Mitchell v. State, 82 Md. 527, 534, 34 A. 246 (1896), or is passed in violation of statute, State Ex. Rel. Sonner v. Shearin, 272 Md. 502, 325 A.2d 573 (1974)."
Although the sentence in the case was not passed in violation of a statute,[10] the Court clearly declared that a direct appeal lies with respect to a sentence which is passed in violation of statute.[11] This may be dictum, but we are constrained to follow so plain a pronouncement by the highest Court of this State.
We have determined that the sentences we are here asked to review were illegal in whole or in part under statute or *323 under Maryland Rules having statutory effect. It is manifest from the transcript of the proceedings at the penalty stage of the trial that the trial judge, although attempting to correct the sentence of 23 April 1975, did so by imposing, over objection, a new sentence which was itself illegal, and later attempted to correct that new sentence by an order which it had no right to issue and which imposed a sentence which was also illegal. We believe that under the authority of Kenneth Ricardo Johnson v. State, supra, the appeal is properly before us. The motion to dismiss it is denied.
Motion to dismiss appeal denied; conviction affirmed; order striking sentence of 23 April 1975 vacated and that sentence reinstated with direction that it be modified pursuant to this opinion; sentence of 28 April 1975 vacated; order of 22 May 1975 reversed; case remanded for further proceedings in accordance with this opinion.
NOTES
[1]  Maryland Rule 724 provides that an accused may enter a plea of guilty to a degree of an offense, which, by law may be divided into degrees of guilt. Compare, Code, Art. 27, § 412. See Smith v. State, 5 Md. App. 633, 634, n. 1 (1969). But see Acts 1975, ch. 252, § 1. No question about the plea, its acceptance and the verdict rendered is raised here.
[2]  Pending the appeal application for review of sentence was made. On 5 July 1973 the Review Panel ordered that the sentence remain unchanged.
[3]  The docket entry reads: "April 28, 1975 - - - - - - - - - Judgment: Fifteen (15) Years c/o Commissioner of Correction dating from 8 September, 1973. Grady, J." We find no mention of 8 September 1973 in the transcript of the sentencing proceedings. This would make the credit 19 months 20 days. From May 8th, 1973, through December 23, 1974, the time served was 19 months and 15 days.
[4]  Mrs. Smith requested the Clerk: "Please file an Appeal in the above captioned case on behalf of the Petitioner who was sentenced on April 28, 1975." She asked that the appeal be assigned to the Public Defender's Office "as I am currently indigent and without funds."
[5]  Section b 1 also provides that upon expiration of the period specified the court has such revisory power and control only in case of fraud, mistake or irregularity. By § b 4, bastardy, desertion and non-support cases are without the Rule. In such cases the court may at any time before expiration of sentence, reduce, change or modify or suspend the sentence or place the accused upon probation upon such conditions and terms as the court may impose.

Section b 2 requires that a modification or reduction of sentence must be made in open court and only after notice to the defendant and the State's Attorney. "A new judgment of conviction, setting forth the revised sentence and specifying the modification or reduction made, shall be entered of record so that the docket entries reflect the action taken."
[6]  The provisions of Rule 764, § a and § b 1 have been construed to be "statutory" in effect. Johnson v. State, 274 Md. 29, 44 (1975).
[7]  Brown, at 503, points out that there are constitutional prohibitions against increasing the sentence of a person who has begun serving that sentence in a penal institution.
[8]  Mrs. Smith contends on appeal that "the trial judge violated [her] constitutional right not to incur multiple punishments for the same offense by increasing [her] sentence from twelve to fifteen years imprisonment." As we have resolved the issue pertaining to the sentence on the basis of statute and rule, we do not reach the constitutional question.
[9]  In Costello v. State, 240 Md. 164 (1965), however, the Court of Appeals felt justified in treating the direct appeal as though it had come before it as an application for leave to appeal from denial of relief under post conviction procedures. It so treated the appeal and granted leave to appeal "since the sentences which form the basis for the attempted appeal are illegal." It thereupon, at 168, overruled the motion to dismiss the appeal and struck the illegal sentences.
[10]  The Court observed that the sentence of 12 years imposed was not in violation of the duration of imprisonment allowable by law. 274 Md. at 538.
[11]  State ex rel. Sonner v. Shearin, 272 Md. 502 (1974), which the Court gave as its authority, held that the State had the right to appeal from a denial of a motion to correct an illegal sentence imposed upon conviction of a crime committed prior to 1 January 1974. See State v. Ward, 31 Md. App. 68 (1976). We think that it necessarily follows that if the State has the right to appeal in such circumstances, the accused, enjoying even broader appeal right in criminal actions, has the right to appeal. Apparently, as Shearin was cited, the Court of Appeals shares this view. We note that the crime of which Mrs. Smith was convicted was committed prior to 1 January 1974. See also State v. Wooten, 277 Md. 114 (1976).

We observe that ch. 49, Acts 1976, to be codified as Courts Art. 12-302 (c), signed by the Governor 1 April 1976 and effective 1 July 1976, authorizes the State to appeal from a final judgment if the State alleges that the trial judge failed to impose the sentence specifically mandated by the Code.
