Peel and grate the potatoes then place in a strainer and squeeze out excess liquid. Transfer to a bowl and combine with the onion, garlic, ham, cayenne and parsley, reserving a little to garnish, then season.
Heat the oil and butter in a 20cm ovenproof frypan over 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 reserved parsley to serve.