In this paper we shall be concerned with the existence of almost homoclinic
solutions of the Hamiltonian system $\ddot{q}+V_q(t,q)=f(t)$, where $t\in\mathbb{R}$,
$q\in\mathbb{R}^n$ and $V(t,q)=-\frac{1}{2}(L(t)q,q)+W(t,q)$. It is assumed that $L$
is a conti\-nuous matrix valued function such that $L(t)$ are symmetric
and positive definite uniformly with respect to $t$. A map $W$ is $C^1$-smooth,
$W_q(t,q)=o(|q|)$, as $q\to 0$ uniformly with respect to $t$ and
$W(t,q)|q|^{-2}\to\infty$, as $|q|\to\infty$. Moreover, $f\neq 0$ is continuous
and sufficiently small in $L^2(\R,\mathbb{R}^n)$. It is proved that this Hamiltonian
system possesses a solution $q_{0}\colon\mathbb{R}\to\mathbb{R}^n$ such that $q_{0}(t)\to 0$,
as $t\to\pm\infty$. Since $q\equiv 0$ is not a solution of our system,
$q_{0}$ is not homoclinic in a classical sense. We are to call such a solution
almost homoclinic. It is obtained as a weak limit of a sequence of almost
critical points of an appropriate action functional $I$.