Ellington, Justice.The Superior Court of Jenkins County granted Jeffrey Watson’s petition for a writ of habeas corpus and set aside his convictions for family violence aggravated battery based on its finding that Watson’s plea counsel provided him with ineffective assistance in connection with the entry of his guilty plea. The Warden appeals, arguing that the habeas court applied an incorrect standard in evaluating Watson’s claim of ineffective assistance. For the reasons explained below, we vacate the order and remand the case to the habeas court for further proceedings consistent with this opinion.A conviction based on a guilty plea may be challenged on the ground that defense counsel was constitutionally ineffective. See Hill v. Lockhart, 474 U. S. 52, 58-59 (106 SCt 366, 88 LE2d 203) (1985). To prove his claim, Watson was required to show that his counsel’s performance was deficient, that is, that no reasonable attorney would have done what his lawyer did, or failed to do what his lawyer did not. See Strickland v. Washington, 466 U. S. 668, 687689 (104 SCt 2052, 80 LE2d 674) (1984); State v. Worsley, 293 Ga. 315, 323 (3) (745 SE2d 617) (2013). He was also required to demonstrate prejudice, that is, “that there is a reasonable probability that, but for counsel’s errors, he would not have pleaded guilty and would have insisted on going to trial.” Hill, 474 U. S. at 59. In reviewing the grant or denial of a petition for habeas corpus, this Court accepts the habeas court’s factual findings and credibility determinations unless they are clearly erroneous, but we independently apply the law to the facts. See Schofield v. Meders, 280 Ga. 865, 866 (632 SE2d 369) (2006).The record shows that Watson was indicted by a Jackson County grand jury on May 9, 2016, for criminal attempt to commit malice murder, two counts of family violence aggravated battery, and family violence aggravated assault in connection with the stabbing of his father. With the assistance of counsel, Watson pleaded guilty to both counts of aggravated battery and to one count of aggravated assault. The State agreed to enter an order of nolle prosequi on the attempted murder count. The superior court sentenced Watson as a recidivist, imposing twenty years’ imprisonment on the first count of aggravated battery and a consecutive ten-year term of probation on the second count. The court merged the aggravated assault count.In November 2017, Watson filed a petition for a writ of habeas corpus, alleging, inter alia, that plea counsel was ineffective for failing timely to advise him that he would be sentenced as a recidivist pursuant to OCGA § 17-10-7 (c) and that he would be ineligible for parole. An evidentiary hearing was held on April 17, 2018. Watson and his plea counsel testified and the Warden introduced into evidence a copy of Watson’s plea hearing transcript.The transcript of the plea hearing shows that, after the superior court had accepted Watson’s plea, the State recommended that Watson be sentenced as a recidivist. Defense counsel objected, arguing that the State had not provided the required notice of its intent to seek recidivist punishment. After finding the State’s notice in an email that had been forwarded to him from his former law firm, counsel acknowledged that the State had indeed sent the notice, although to an old address. Counsel then explained the State’s sentencing intentions to Watson. During the hearing on Watson’s habeas petition, plea counsel testified that he had a brief, whispered discussion with Watson about the consequences of recidivist punishment and his option to withdraw his guilty plea before the court imposed sentence. Counsel testified that, if he thought that Watson did not understand what they had discussed, he would have asked the court to delay the proceeding. Watson, however, testified that plea counsel did not discuss recidivist punishment with him and that, if he had understood the consequences of the recidivist punishment sought by the State, he would not have pleaded guilty.On June 22, 2018, the habeas court entered a brief, written order finding that counsel’s performance was deficient because he “failed to adequately advise [Watson] that he would be sentenced as a recidivist until after his plea was already entered.” The habeas court did not evaluate whether counsel’s deficient performance prejudiced Watson. Rather, the court concluded that prejudice was “apparent because [Watson] was deprived of constitutionally sufficient performance.”The Warden does not challenge the habeas court’s findings concerning plea counsel’s deficient performance. Rather, the Warden contends only that the habeas court, by “conflating” deficient performance and prejudice, failed to properly analyze whether Watson was prejudiced by counsel’s deficient performance. The deficient performance and prejudice prongs of the Strickland test are two separate inquiries, and the habeas court was, indeed, required to determine whether Watson had shown “that there is a reasonable probability that, but for counsel’s errors, he would not have pleaded guilty and would have insisted on going to trial.” Hill, 474 U. S. at 59.We cannot, as Watson argues, simply uphold the grant of habeas corpus relief because it is “the right decision.” Because the habeas court failed to properly analyze the prejudice prong, its order lacks a factually supported legal conclusion essential to its ruling on Watson’s ineffective assistance of counsel claim and essential to our appellate review of that ruling. Therefore, we vacate the habeas court’s judgment and remand this case to the habeas court with instruction to enter a new order consistent with this opinion and containing the requisite findings of fact and conclusions of law. See OCGA § 9-14-49; Thomas v. State, 284 Ga. 327, 328 (2) (667 SE2d 375) (2008), overruled on other grounds, Crosson v. Conway, 291 Ga. 220, 222 (728 SE2d 617) (2012).Judgment vacated and remanded with direction. All the Justices concur.