Peel and grate the potatoes then place in a strainer and squeeze out the excess liquid. Season with salt and pepper. Transfer to a bowl and combine with the onion, garlic, ham, cayenne pepper and parsley, reserving a little to garnish.
Heat the oil and butter in a 20 cm ovenproof frying pan over a medium heat, swirling to coat the base. Spoon the potato mixture over the base of the pan and press down gently to make an even layer.
Reduce the heat to medium-low and cook for 20 minutes or until the base is golden and the potato is almost cooked through. Transfer the pan to the oven and bake for 15 minutes or until the top is golden and the potato is cooked and tender. Sprinkle with the remaining parsley to serve.