  In the present paper a new cosmological model is proposed by extending the
Einstein--Hilbert lagrangian with a generic functional $f(R,P)$, which depends
on the scalar curvature $R$ and a term $P$ which encodes a possible influence
from specific cubic contractions of the Riemann tensor. After proposing the
corresponding action, the associated modified Friedmann relations are deduced,
in the case where the generic functional has a power law decomposition,
$f(R,P)=f_0 R^n+g_0 P^m$, with $f_0, g_0, n, m$ constant parameters. In this
case the specific method of dynamical system analysis is employed, revealing
the fundamental properties of the phase space structure, discussing the
dynamical consequences for the cosmological solutions obtained. It is revealed
that the cosmological solutions associated to the critical points can explain
various dynamical eras, with a high sensitivity to the values of the $n$ and
$m$ parameters, encoding various effects due to the geometrical nature of the
specific couplings.
