In the present work, we have investigated an extension of the effective nucleon-nucleon Gogny interaction in which the zero-range density-dependent term has been replaced with a finite-range term. The parameters have been adjusted on both nuclear-matter properties and a few observables of stable nuclei. The traditional and unified fitting procedure of the Gogny force used in Bruyères-le-Châtel ensures common basic properties between the extended analytical form of the Gogny interaction, called D2, and the original one. In particular, symmetric infinite nuclear-matter and neutron-matter properties as well as pairing correlations have been investigated. A few static properties obtained in finite nuclei using the Hartree-Fock-Bogoliubov approach and the D2 parametrization of the Gogny interaction are analyzed and compared to the results obtained with D1-type parametrizations and experiment when it is possible. The D2 parametrization makes it possible to reproduce nuclear structure properties with improved accuracy.