We present a method for efficiently solving stochastic optimization problems of discrete event systems. The new method, the nested partitions (NP) method, uses partitioning, random sampling, selection of a promising index, and backtracking techniques to crete a Markov chain which has been proven with probability one to converge to a global optimum. One important feature of the NP method is that it can combine global search and local search procedures in a natural way. In particular, many sample path analysis techniques such as perturbation analysis and concurrent simulation can be effectively incorporated into the method. The NP method is demonstrated through a numerical example.