Let p>3 be a prime, and let m be an integer with p∤m. In the paper we solve some conjectures of Z.W. Sun concerning ∑k=0p−1(k2k)3/mk(modp2), ∑k=0p−1(k2k)\b4k2k/mk(modp) and ∑k=0p−1(k2k)2\b4k2k/mk(modp2). In particular, we show that ∑k=02p−1(k2k)3≡0(modp2) for p≡3,5,6(mod7). Let Pn(x) be the Legendre polynomials. In the paper we also show that P[4p](t)≡−(p−6)∑x=0p−1(px3−3/2(3t+5)x−9t−7)(modp) and determine P2p−1(2),P2p−1(432),P2p−1(−3),P2p−1(23),P2p−1(−63),P2p−1(837)(modp), where t is a rational p−integer, [x] is the greatest integer not exceeding x and (pa) is the Legendre symbol. As consequences we determine P[4p](t)(modp) in the cases t=−5/3,−7/9,−65/63 and confirm many conjectures of Z.W. Sun.