With the aid of the weak maximum principle at infinity we give some sufficient conditions for Riemannian manifolds to be either Einstein or of constant sectional curvature.