A mixed-type Galerkin variational principle is proposed for a generalized nonlocal elastic model. The solvability and regularity of its solution is naturally derived through the Lax---Milgram lemma, from which a solvability criterion is inferred for a Fredholm integral equation of the first kind. A mixed-type finite element procedure is therefore developed and the existence and uniqueness of the discrete solution is proved. This compensates the lack of solvability proof for the collocation-finite difference scheme proposed in Du et al. (J Comput Phys 297:72---83, 2015). Numerical error bounds for the unknown and the intermediate variable are proved. By carefully exploring the structure of the coefficient matrices of the numerical method, we develop a fast conjugate gradient algorithm , which reduces the computations to $$\mathcal {O}(NlogN)$$O(NlogN) per iteration and the memory to $$\mathcal {O}(N)$$O(N). The use of the preconditioner significantly reduces the number of iterations. Numerical results show the utility of the method.