There exists a positive constant α < 1 such that for any function T (n) ≤ n α and for any problem L ∈ BPTIME(T (n)), there exists a deterministic algorithm running in poly(T (n)) time which decides L, except for at most a 2 −Ω(T (n) log T (n)) fraction of inputs of length n. The proof uses a novel derandomization technique based on a new type of randomness extractors, called exposure-resilient extractors. An exposure-resilient extractor is an efficient procedure that, from a random variable with imperfect randomness, produces randomness that passes all statistical tests including those that have bounded access to the random variable, with adaptive queries that can depend on the string being tested. More precisely, EXT : {0, 1} n × {0, 1} d → {0, 1} m is a (k, )-exposure-resilient extractor resistant to q queries if, when the minentropy of the random variable x is at least k and the random variable y is uniformly distributed, EXT(x, y) looks -random to all statistical tests modeled by oracle circuits of unbounded size that can query q bits of x. Besides the extractor that is needed for the proof of the main result (whose parameters are tailored for this application), we construct, for any δ < 1, a polynomial-time computable (k, )-exposure-resilient extractor with query resistance n δ , k = n − n Ω(1) , = n −Ω(1) , m = n Ω(1) and d = O(log n).