A crucial requirement for quantum information processing is the realization of multiple-qubit quantum gates. Here, we demonstrate an electron spin based all-electrical two-qubit gate consisting of single spin rotations and inter-dot spin exchange in a double quantum dot. A partially entangled output state is obtained by the application of the two-qubit gate to an initial, uncorrelated state. We find that the degree of entanglement is controllable by the exchange operation time. The approach represents a key step towards the realization of universal multiple qubit gates.