The refusal of the trial court to consider the petition for a writ of error coram nobis upon its merits is affirmed. It is clear that this petition should be addressed to the district court in which the petitioner was tried. State v. Green, 277 N.C. 188, 176 S.E. 2d 756. This rule is equally applicable whether the defendant was tried in superior court or in an inferior court. In Green the petitioner was convicted of nonsupport in the Reids-ville Recorder’s Court, an inferior court which has now been replaced by the district court. He petitioned the Rockingham County Superior Court for a writ of error coram nobis, and the Supreme Court held that the petition should have been addressed to the Recorder’s Court. The Court explained its decision as follows: “ ‘The writ of error coram nobis “is brought for an alleged error of fact, not appearing upon the record, and lies to the same cov/rt, in order that it may correct the error, which it is presumed would not have been committed had the fact in the first instance been brought to its notice.” ’ ” Id. at 192, 176 S.E. 2d at 759.
 Under the common law a defendant could use the writ of error coram nobis “to challenge the validity of a conviction by reason of matters extraneous to the record.” Id. at 191, 176 S.E. 2d at 759. In North Carolina this writ has been superseded by *58the Post-Conviction Hearing Act, G.S. 15-217 to -222, with respect to defendants who have been sentenced to prison. The writ is still available, however, to defendants who have been convicted but not imprisoned. State v. Green, supra. See also Dantzic v. State, 279 N.C. 212, 182 S.E. 2d 563; State v. Daniels, 231 N.C. 17, 56 S.E. 2d 2; In re Taylor, 230 N.C. 566, 53 S.E. 2d 857.
Chief Judge Brock and Judge Campbell concur.