Nowadays mobile networks are asked to support different applications and services characterized by very specific Quality of Service (QoS) requirements. With this aim in mind, deploying network slices with particular resource allocation policies on a per-service basis becomes extremely relevant. In this regard, we introduce a solution able to dynamically partition the underlying physical infrastructure of a mobile radio access network into multiple logical slices with distinctive service-level agreements. We leverage Software-Defined Networking principles to provide fine-grained flow identification and sophisticated QoS management policies on a generic architecture supporting 4G and 5G networks with the objective of mapping the path towards the future mobile networks. The experimental evaluation of the deployed prototype on a real-world testbed has demonstrated the slicing capabilities of the system while ensuring full performance and functional isolation. We release the entire implementation under a permissive APACHE 2.0 license for academic use.