
232 Ga. 876 (1974)
209 S.E.2d 207
ELROD
v.
CALDWELL.
29085.
Supreme Court of Georgia.
Argued September 10, 1974.
Decided October 1, 1974.
James C. Bonner, Jr., for appellant.
UNDERCOFLER, Justice.
Clyde Elrod filled an application for the writ of habeas corpus against the respondent warden in which he asserts that he plead guilty to an accusation for motor vehicle theft under Code Ann. § 26-1813 (Ga. L. 1968, pp. 1249, 1295; 1969, pp. 857, 861) which did not charge him with a second offense. Therefore, he contends that he should have been sentenced as a first offender and should have received a sentence of one to seven years instead of the ten years which was imposed on him as a second offender.
The evidence and the record show that the appellant was represented by counsel, was fully advised of all of his rights including the fact that he could receive a sentence of ten years, and that he waived indictment and plead guilty before the trial court. The accusation on which he *877 was sentenced shows on its back that for the first offense, the penalty was three to seven years or misdemeanor punishment, for the second offense, five to ten years, and for the third offense, ten to twenty years. The trial judge sentenced the appellant to ten years.
In Black v. Caldwell, 231 Ga. 589, 592 (203 SE2d 208) this court held that an accused could not receive a sentence greater than that prescribed by law for the crime for which he was indicted and convicted and that for one to receive recidivist punishment he must have been indicted under a recidivist statute, his prior convictions having been considered by the Grand Jury and having been included in the indictment. "In short, one cannot be indicted by a Grand Jury for only one offense carrying a maximum punishment, and then have that maximum punishment increased at the election of the state's prosecuting officers." P. 593.
In Studdard v. State, 225 Ga. 410 (1) (169 SE2d 327) this court held that the indictment by the state seeking to impose a greater penalty for an illegal act because of the defendant's alleged "incorrigible and dangerous character" resulting from prior convictions, required that such prior convictions be alleged in the indictment. The Studdard case also held that, "It would be a travesty on justice to permit an accusation, required to be furnished on demand, under Art. I, Sec. I, Par. V of the Constitution (Code Ann. § 2-105) to charge a felony punishable by imprisonment for one period of time and then to permit evidence to be introduced which would authorize imprisonment for a longer period of time."
The Black and Studdard cases were based on indictments and this case is on a plea of guilty to an accusation. Although an accusation can be amended (Cook v. Walker, 161 Ga. 551 (1) (131 SE 288)), this accusation does not reflect that it was. Therefore, under the ruling made in the Black and Studdard cases, the appellant was not charged as a recidivist and could not have been sentenced as a second offender by the trial court. However, the plea of guilty is a valid judgment and only the sentence is illegal.
The habeas corpus court is, therefore, directed to enter an order vacating the sentence given the appellant *878 as a second offender and is directed to remand the case to the Mitchell County Superior Court for resentencing of the appellant by the trial court as a first offender.
Judgment reversed with direction. All the Justices concur.
