Let p > 3 be a prime, and let a be a rational p-adic integer. Let {B n (x)} denote the Bernoulli polynomials given by B 0 = 1, [Formula: see text] and [Formula: see text]. In this paper, using Bernoulli polynomials we establish congruences for [Formula: see text] and [Formula: see text]. As a consequence we solve the following conjecture of Z. W. Sun: [Formula: see text] where [Formula: see text].