We obtain the following generalization of a well known result of Huppert. If p is the largest primer divisor of the order of a finite group G and q is any prime distinct from p, then G is supersolvable if and only if every maximal subgroup whose index is relatively prime to either p or q, has prime index.