  The Ap\'ery numbers $A_n$ and central Delannoy numbers $D_n$ are defined by
$$A_n=\sum_{k=0}^{n}{n+k\choose 2k}^2{2k\choose k}^2, \quad
D_n=\sum_{k=0}^{n}{n+k\choose 2k}{2k\choose k}. $$ Motivated by some recent
work of Z.-W. Sun, we prove the following congruences:
\sum_{k=0}^{n-1}(2k+1)^{2r+1}A_k &\equiv \sum_{k=0}^{n-1}\varepsilon^k
(2k+1)^{2r+1}D_k \equiv 0\pmod n, where $n\geqslant 1$, $r\geqslant 0$, and
$\varepsilon=\pm1$. For $r=1$, we further show that
\sum_{k=0}^{n-1}(2k+1)^{3}A_k &\equiv 0\pmod{n^3}, \quad
\sum_{k=0}^{p-1}(2k+1)^{3}A_k &\equiv p^3 \pmod{2p^6}, where $p>3$ is a prime.
The following congruence \sum_{k=0}^{n-1} {n+k\choose k}^2{n-1\choose k}^2
\equiv 0 \pmod{n} plays an important role in our proof.
