Let be a graph of order , and let and be integers such that . Let and be two nonnegative integer-valued functions defined on such that for each . Then has a -factor if the minimum degree , and for any two nonadjacent vertices and in . Furthermore, it is shown that the result in this paper is best possible in some sense.