We find a one-parameter family of polynomial Hamiltonian system in two variables with $W({A}^{(1)}_1)$-symmetry. We also show that this system can be obtained by the compatibility conditions for the linear differential equations in three variables. We give a relation between it and the second member of the second Painleve hierarchy. Moreover, we give some relations between an autonomous version of its polynomial Hamiltonian system in two variables and the mKdV hierarchies.