Under AEDPA, when petitioner is ineligible for statutory tolling of time to file his petition, he may be eligible for equitable tolling if he shows that he diligently pursued his rights under then-existing law, but an extraordinary circumstance, such as a subsequent change of law, prevented him from timely filing. Following direct appeal denials of his conviction for murder in the California state courts, Townsend filed a habeas corpus petition in the state Superior Court, which was denied as both untimely and without merit. He next filed habeas petitions in the state Court of Appeal and Supreme Court, which were summarily denied. Townsend then filed his federal habeas corpus petition, which complied with the AEDPA limitations period (28 U.S.C. § 2244(d)) under then-existing Ninth Circuit authority that permitted statutory tolling while an untimely state habeas petition was pending. Later, the U.S. Supreme Court overruled that Ninth Circuit authority in Pace v. DiGuglielmo (2005) 544 U.S. 408. The Ninth Circuit held that Townsend was not entitled to statutory tolling of the AEDPA limitations period, because under the last reasoned state court decision the Superior Courts ruling, since the appellate courts issued postcard denials Townsends state habeas petition was untimely; and under Pace, an untimely state habeas petition did not toll the limitations period. However, the Ninth Circuit also held that Townsend was entitled to equitable tolling, because he was justified in relying on existing Ninth Circuit authority when he filed his federal petition, even though through no fault of his own, that petition later became time-barred the moment Pace was decided. Consequently, Townsend was entitled to the limitations period called for by the Ninth Circuit authority on which he relied when he filed his federal petition, and the petition was not time-barred.