Lewis Hamilton claimed a slice of history at his home circuit, but only after being pushed hard by Ferrari.